Page 1 of 1

SOLVED Section Header link?

Posted: Fri Dec 20, 2013 1:03 pm
by CMSmonkey
Hello,
I do not know where else to put this question, so I hope this is the right place.

I am using the Section Header option for holding the place in my menu for submenu pages.

What I typically have seen on website with this sort of function is that it provides a "#" link for the page, so if someone clicks it when they are on any page, it doesn't take them anywhere.

I have noticed on CMSMS that this works when you are on the home page as the link comes up as mysite.com/#. However, when I am on another page, lets say "contact", the link will still be mysite.com/# and not mysite.com/contact/#. So it will take someone to the home page instead of making them sit on the contact page.

Am I missing something here? Please note that I am using pretty URLs on the site so I am not sure if this has an effect.

Thanks.

Re: Section Header link?

Posted: Fri Dec 20, 2013 2:11 pm
by velden
I think this is caused by the <base> tag which automatically comes with the {metadata} tag (but that has an option to disable it).

IIRC I sometimes just make the section headers have an <a> tag without href attribute. However, could be that ipad's (maybe other browsers too) don't like that and prevent the hover event. You should test that.

Re: Section Header link?

Posted: Sat Dec 21, 2013 5:34 am
by CMSmonkey
Gotcha. Thanks for the suggestion Velden. I tried that out and it seemed to work on various mobile browsers, ipad, and desktop browsers except for an Android on Opera browser.

So I tried this and it seems to keep you on the page:

Code: Select all

<a href="{$smarty.server.REQUEST_URI}/#"><span>{$node->menutext}</span></a>
There might be a better way to do it but at least it works for now.

If anyone has any other suggestions please let me know. Otherwise I'll consider this SOLVED.

Thanks.

Re: SOLVED Section Header link?

Posted: Mon Dec 30, 2013 8:29 pm
by Dr.CSS
I would make a custom menu template that checks for sectionheaders and remove any reference to 'a' links, so no href= etc...