Using anchor links within Autonav - SOLVED

Permalink
Hi there,

I came across to one issue that has two possible solutions. However none of them work, so I was hoping someone has a better knowledge and is wishing to share :)

I want to link to anchor in AutoNav, but by default it is not supported (at least to my knowledge). So I went on creating an external link that looks like this:

http://www.mysite.co.uk/c5/index.php/services#orange-main-section-id

Originally this page had a page list block with subpages beneath. The page list was pulling posts from the sub-pages, but after creating external link I had to hide it from nav.

Now, it no longer picks up the posts. I have changed the settings to pick up from another page and updated the custom template, but it doesn't work. I have used the same process is pulling the blog posts in other pages and it functions just fine. It seems that it is caused by external link or some c5 architecture that is beyond my experience. It is just my humble presumption.

So I'm in a corner now, I can't implement the anchor link in AutoNav, and when I make an external link, page list won't wok.

I haven't seen any similar posts for a similar issue. Any help, even if it is a link to a relevant site is appreciated!

 
Mellow replied on at Permalink Best Answer Reply
I wanted to provide an update, for those who might experience a similar issue. I found a solution with Javascript. Instead of aiming to use Concrete5 functionality, I went to the page I was working with ('EXAMPLE.PHP') and implemented a short Javascript code. It will instantly jump to anchor tag as soon as the page is loaded:

element_to_scroll_to = document.getElementById('YourAnchorHere');
element_to_scroll_to.scrollIntoView();
I hope it helps someone.