Scroll to target from a different page!

Hello! Does any one knows how to scroll to target from a different page? The old method doesn’t work any more :frowning:

Do you mean the www.yoursite.com/#blocname
Doesn’t work?
I did it last week and worked fine, although I’m not using latest beta.

For example I got a target on the main page called #options
On the menu there is an item called options that scroll to my target. I would like to go back to #option from another page. Does it make sense?

You will have to point instead scroll to target, go to url and set the url of the ID: index.html/#options but you will loose the smooth scroll capability

this works well for me: with the ‘link’ selected, go to Interactions and under Type: ‘Navigate to URL’, for ‘URL’, enter the page url + bloc ID (#___)…also, uncheck ‘New Tab’ (assuming that’s desired).

scroll URL

Thanks! weird that’s what Im doing but not working!

If you enable clean URLs you have to change the URL to reflect that.

It’s probably as @Malachiman stated.

Scroll to target is only for same page, otherwise it’s navigate to your anchor but you need to supply the right URL. Using clean URLs or not may modify your target URL setting - you can always publish and inspect the URL for the page the anchor is on to find the right one, etc…

afaik there’s a dot missing.
It should be ./index.html#about.
But I may be wrong …

As I understand it… (there could be a better way to explain it, or I could wrong…)

If you start the link with just a / is an absolute path starting from the root.

If you don’t have a leading / eg .. then it is relative from the current folder. (usually to a parent).

./ would be used to link to a file in the same folder.

Exactly.
That’s what I meant.
Usually all my files are in the main folder of the project.

thanks…though as I show it in the screenshot its working on my site as expected, based on how I exported the bloc file into a directory on my computer for uploading to my host.

So a clean url would be /index#about/ right?

You don’t need to start with a dot and don’t end with a /

So just…

/my-page#scroll-2

It hasn’t changed from the “old way” so I don’t know what you were doing before! :face_with_monocle:

I was doing the same think but it just stop working probable a bug got tongs of that :confused:

If you mean a bug in Blocs then no. The browser handles that.

If using clean URLs, everything is in directories…betting its a path problem.
@Malachiman ‘s explanation of path operators is correct.

Do this. Go to your live site and go to the page with the anchor on it you’re trying to reach.
Copy the full URL from the browser address ba into your clipboard, https:// and all.

Go into blocs select the event you want to nav to the anchor, set interaction to Navigate to, and paste the clipboard content in full. Add # with the real anchor, e.g. #myanchor to the end…
Export and update site.
Confirm it works.
Go bac to blocs and got to the Navigate to element…remove everything in the https:// and your host name, e.g. change https://foo.com/pages/index.html#myanchor to: /pages/index.html#myanchor

Save, export and retest. Should all work regardless of URL style, dies, etc.

Blocs preview is a bit hokey from what I’ve seen, and the URL doesn’t update when navigating so publish and use the real url and browser, or use a browser pointing to your export, starting at your exports base index. Use file:///index html or from a terminal or xterm2, cd into the export dir and type: open index.html

You should be able to use file:// etc for a local test with browser but need to still follow step 2 above to remove the protocol and hostname and the updating the nav to url as file:// wont work once published to a live site as you’d expect.
:

It works now but the transition effect bric looses his effect :frowning:

You will have to point instead scroll to target, go to url and set the url of the ID: index.html/#options but you will loose the smooth scroll capability