17488 Posts in 4473 Topics by 1978 members
| Go to End | ||
| Author | Topic: | 3298 Views |
-
Re: How to make top menu sections without content and jump to the first child?

3 September 2008 at 5:29am
I'd like the same type of thing, except I don't need a link outputted from a certain parent page. I need just a blank <a> tag produced from a page in the sitetree, no redirects.
The reason being I am building a suckerfish navigation menu so I still need the <a> tag produced for the parent, so when a user hovers over it, the suckerfish menu is displayed listing the child pages.
Is this at all possible?
-
Re: How to make top menu sections without content and jump to the first child?

3 September 2008 at 7:28pm Last edited: 3 September 2008 7:29pm
Hmm, one way I think you could achieve this would be to override the Link() method on your page-type. This means that for that particular $Link in the template loop for the menu there's nothing returned, thus you can do <% if Link %><a href="$Link">$MenuTitle</a><% else %><span>$MenuTitle</span><% end_if %> - or something similar.
Example:
<?php
class UnlinkedPage extends Page {
function Link() {
return false;
}}
class UnlinkedPage_Controller extends Page_Controller {
}
?>
It's kind of a theory more than anything. I'm not sure if there'll be any side effects from a page not having a valid Link() method, but it's certainly worth a try I believe.
Sean
| 3298 Views | ||
| Go to Top |


