Dropdown menu

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
nakkiel
Forum Members
Forum Members
Posts: 70
Joined: Wed Apr 02, 2008 7:15 am

Dropdown menu

Post 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?
Post Reply

Return to “Modules/Add-Ons”