Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » How to use a drop down menu for navigation?

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

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

Page: 1
Go to End
Author Topic: 3296 Views
  • SilverRay
    Avatar
    Community Member
    167 Posts

    How to use a drop down menu for navigation? Link to this post

    Suppose I want to use a drop down menu for navigation, like so:

    <form action="???" method="post" name="StateSelect">
    <select class="dropdown" name="location" size="1">

    <% control Menu(3) %>
    <option value="$Link">$MenuTitle</option>
    <% end_control %>

    </select>
    <input class="submitbutton" type="submit" value="Find" name="GoState" />
    </form>

    Then what would be the 'action' to put in?

    Thanks,
    - Ray.

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: How to use a drop down menu for navigation? Link to this post

    Hi , a navigation dropdown will not work like that... It needs a bit more. ;-)

    Check out http://www.alistapart.com/articles/dropdowns/ for an easy and accessible example.

    Good luck !

  • SilverRay
    Avatar
    Community Member
    167 Posts

    Re: How to use a drop down menu for navigation? Link to this post

    Thanks for your reply!

    I'm not looking for a css based menu, but really a drop down (as used in a form... but use it for a certain type of navigation)... not possible to populate a drop down like that with links, with SS? I know I can put in link names with a control, but what would the post-action be? If I made myself clear that is ;)

    - Ray

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: How to use a drop down menu for navigation? Link to this post

    You need a bit of script to open the selected URL.

    Check out this page :
    http://www.cs.tut.fi/~jkorpela/forms/navmenu.html

  • SilverRay
    Avatar
    Community Member
    167 Posts

    Re: How to use a drop down menu for navigation? Link to this post

    Right, I used to build drop down menus with server side scripting, but using SS that would be a little different I guess. I thought there would be a custom control built-in for this, but I cannot find it. Then I was thinking of making a function, similar to the one in the tutorial about showing browser polls, but hey, I'm not that good (yet ;)

    Maybe I have to decide on making it css-based though, downside is that it seems to pose problems with IE6...

    Thanks again,
    - Ray.

    3296 Views
Page: 1
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.