Page 1 of 1

Dropdown menu

Posted: Wed Oct 29, 2008 9:57 am
by nakkiel
Hi

I want to create a dropdown menu, which would just create, well, a dropdown menu of certain level of pages. So, I would have a hierarchy like this:

Home > Sub-page > Categories > ...

And on each Sub-page I would have a dropdown menu to each category page. So far I've done this (I modified simple menu a bit):

To page's :

function switch_page(select) {

var index;

for (index=0; index

Dropdown menu template:

Code: Select all

<form action="index.php" name="frmchangepage" method="post">
<select class="select" name="url" onchange="switch_page(this)" style="width: 250px;">
{if $count > 0}
{foreach from=$nodelist item=node}<option value="{$node->url}" 
{if $node->target ne ""} target="{$node->target}"{/if}>
>{$node->menutext}">Default</option>
{if $count > ($node->index+1)}
{/if}
{/foreach}
{/if}
</select>
</form>

And using this as {menu}-tag:
{menu number_of_levels="1" start_level="2" template="dropdown_menu"}



As you can see, my menu template is buggy as hell, and it doesn't show the page you are on as selected. Can someone help me with this?