Jump to:

23551 Posts in 19348 Topics by 2891 members

General Questions

SilverStripe Forums » General Questions » Drop Down Menus with Silverstripe

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1 2 3 4 5
Go to End
Author Topic: 14874 Views
  • animasola
    Avatar
    Community Member
    121 Posts

    Re: Drop Down Menus with Silverstripe Link to this post

    I also have the same problem and I got what willr posted and implemented it. Problem is, it doesn't work with a child of a child page, like a third level menu. I only goes down once and it doesn't make another list for the children of a level two page. I hope you understand what I'm trying to say.

    Any thoughts?

  • hive.net.au
    Avatar
    Community Member
    40 Posts

    Re: Drop Down Menus with Silverstripe Link to this post

    Hi Animasola,

    I have modified the code to produce three levels, you can use the same logic to go to further levels. However i have not written the CSS for this yet. Will post that soon.

    <!-- [if IE6]><div id="IE6"><![endif]-->
    <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><!--[if gte IE 7]><!--></a><!--<![endif]-->
                <!--[if lte IE 6]><table><tr><td><![endif]-->
                <ul class="sub1">
                   <% control Children %>
                      <% if Children %>
    <li class="top $LinkingMode"><a href="$Link" class="top_link" title="View more info about $Title"><span>$MenuTitle</span><!--[if gte IE 7]><!--></a><!--<![endif]-->
    <!--[if lte IE 6]><table><tr><td><![endif]-->
                <ul class="sub1">
                   <% control Children %>
    <li><a href="$Link" title="View more about $Title" class="fly $LinkingMode">$MenuTitle</a></li>
    <% end_control %>
    </ul><!--[if lte IE 6]></td></tr></table></a><![endif]-->
             </li>
    <% else %>   

    <li><a href="$Link" title="View more about $Title" class="fly $LinkingMode">$MenuTitle</a></li>
    <% end_if %>
                   <% end_control %>
                </ul>
             <!--[if lte IE 6]></td></tr></table></a><![endif]-->
             </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>
    <!-- [if IE6]></div><![endif]-->

    Thanks to willr for the orginal code

  • hive.net.au
    Avatar
    Community Member
    40 Posts

    Re: Drop Down Menus with Silverstripe Link to this post

    Please find the code attached for a three level drop down menu, thanks to willr for the orginal code and cssmenu.co.uk for the css. Only very slightly changed.

    Attached Files
  • Taffy
    Avatar
    Community Member
    119 Posts

    Re: Drop Down Menus with Silverstripe Link to this post

    Nice one. It would be good if you could post it on Aram's http://ssbits.com/ site

  • hive.net.au
    Avatar
    Community Member
    40 Posts

    Re: Drop Down Menus with Silverstripe Link to this post

    I will post it up there.

  • DrWebGuy
    Avatar
    Community Member
    16 Posts

    Re: Drop Down Menus with Silverstripe Link to this post

    Try as I may, I cannot find the Menu1.css attachment. Has it been removed? Or is there another copy somewhere I could get my hands on?

  • hive.net.au
    Avatar
    Community Member
    40 Posts

    Re: Drop Down Menus with Silverstripe Link to this post

    It used to be there i thought, sorry about that here they are again.

    Attached Files
  • DrWebGuy
    Avatar
    Community Member
    16 Posts

    Re: Drop Down Menus with Silverstripe Link to this post

    Have you ever had any issues using FireFox with this menu? I LOVE the css menu, but just recently noticed that in Firefox when you move the mouse down over the sub-menu it disappears. I compared the css with the "original" from cssmenu.co.uk line by line and I cannot find the discrepancy. It works fine in every browser on their site, but when it is implemented through Silverstripe on my site it suddenly stops functioning correctly. Oddly enough it works like a dream in Safari and IE8. Any thoughts? I have searched for a solution for days and still no luck.

    14874 Views
Page: 1 2 3 4 5
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.