21307 Posts in 5737 Topics by 2603 members
General Questions
SilverStripe Forums » General Questions » make the parent page unclickable from the drop down menu
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 445 Views |
-
make the parent page unclickable from the drop down menu

30 May 2012 at 7:34pm
Hello guys!
I want to disable the parent page from the drop down menu (navigation).
Lets say that this is my menu.Home | News | Information | Matches | Photos | Contact
When I hover with my mouse on Information, there comes a drop down menu, with a couple of childs.. ( see attached file)
So i want to disable (unclickable or whatever) the INFO from the drop down, but you can click on childs...Thanks already
-
Re: make the parent page unclickable from the drop down menu

31 May 2012 at 6:21pm
Say this is your Navigation code:
<ul class="mainMenu">
<% control Menu(1) %>
<li class="liMainMenu">
<a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode aMainMenu">$MenuTitle.XML</a>
<% if children %>
<ul class="subMenu1">
<% control children %>
<li class="liSubMenu1"><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode aSubMenu1">$MenuTitle.XML</a></li>
<% end_control %>
</ul>
<% end_if %>
</li>
<% end_control %>
</ul>You would want to change it to this:
<ul class="mainMenu">
<% control Menu(1) %>
<li class="liMainMenu">
<% if children %>
<span class="$LinkingMode aMainMenu">$MenuTitle.XML</span>
<ul class="subMenu1">
<% control children %>
<li class="liSubMenu1"><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode aSubMenu1">$MenuTitle.XML</a></li>
<% end_control %>
</ul>
<% else %>
<a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode aMainMenu">$MenuTitle.XML</a>
<% end_if %>
</li>
<% end_control %>
</ul> -
Re: make the parent page unclickable from the drop down menu

31 May 2012 at 10:48pm
Hi Guys,
I'm also trying to achieve this as well. I am very new to Silverstripe.
My navigation code is:
<ul id="Menu1">
<% control Menu(1) %>
<% if Children %>
<li class="top $LinkingMode"><a href="$Link" class="top_link" title="View more info about $Title"><span>$MenuTitle</span></a>
<ul class="sub1">
<% control Children %>
<li><a href="$Link" title="View more about $Title" class="fly $LinkingMode">$MenuTitle</a></li>
<% end_control %>
</ul>
</li>
<% else %>
<li class="top $LinkingMode"><a href="$Link" class="top_link" title="View more info about $Title"><span>$MenuTitle</span></a></li>
<% end_if %>
<% end_control %>
</ul>I have multiple child menu's for different parent pages but only want to disable the parent of 1 of them. Thanks, been trying for hours. Being new to this it might be a lot simpler than I realise.
-
Re: make the parent page unclickable from the drop down menu

31 May 2012 at 11:18pm
Thanks it worked for me!
@knrd you have to delete <a href="$Link" class="top_link" title="View more info about $Title"> and </a>...
This is mine now:
<div id="navigation_row"> </div>
<!-- [if IE6]><div id="IE6"><![endif]-->
<ul id="menu_list">
<% control Menu(1) %>
<% if Children %>
<li class="top $LinkingMode">
<span class="top_link" title="$Title">$MenuTitle</span>
<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul class="sub1">
<% if ClassName != NewsArticleHolder %>
<% control Children %>
<li><a href="$Link" title="$Title" class="fly $LinkingMode" <% if is_a(RedirectorPage) %><% if RedirectionType = External %>target="_blank"<% end_if %><% end_if %>>$MenuTitle</a></li>
<% end_control %>
<% end_if %>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<% else %>
<li class="top $LinkingMode"><a href="$Link" class="top_link" title="$Title"><span>$MenuTitle</span></a></li>
<% end_if %>
<% end_control %>
</ul>
<!-- [if IE6]></div><![endif]-->I hope you'll solve it
-
Re: make the parent page unclickable from the drop down menu

4 June 2012 at 1:18pm
knrd, one thing you could do is in the CMS make that parent page a redirector page, and redirect it to the first child.
-
Re: make the parent page unclickable from the drop down menu

6 June 2012 at 11:31am
Thanks very much. Ampedup that sounds like the best solution. Will see how I go.
| 445 Views | ||
|
Page:
1
|
Go to Top |


