Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

How to make top menu sections without content and jump to the first child?


Reply

10 Posts   3621 Views

Avatar
Liam

3 September 2008 at 5:29am Community Member, 470 Posts

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?

Avatar
Sean

3 September 2008 at 7:28pm (Last edited: 3 September 2008 7:29pm), Forum Moderator, 921 Posts

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