SOLVED Section Header link?

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
CMSmonkey
Power Poster
Power Poster
Posts: 290
Joined: Thu Nov 27, 2008 4:58 pm

SOLVED Section Header link?

Post 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.
Last edited by CMSmonkey on Sat Dec 21, 2013 5:35 am, edited 1 time in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Section Header link?

Post 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.
CMSmonkey
Power Poster
Power Poster
Posts: 290
Joined: Thu Nov 27, 2008 4:58 pm

Re: Section Header link?

Post 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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: SOLVED Section Header link?

Post 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...
Locked

Return to “Layout and Design (CSS & HTML)”