Page 1 of 1
[Solved] Displaying the child objects of a drop down menu
Posted: Mon Jan 24, 2011 6:12 pm
by DoctorWho
I don't know if this is the right section for this post, feel free to move it if need be.
Is it possible to display the child objects of a drop-down menu on a web page using the menu manager?
My site currently looks like
this:
and I want it to look like
this when the parent menu object has children:
Re: Displaying the child objects of a parent drop down menu
Posted: Mon Jan 24, 2011 6:49 pm
by Dr.CSS
Are you wanting the child pages of the active top menu item to be displayed on the left side?...
Re: Displaying the child objects of a parent drop down menu
Posted: Mon Jan 24, 2011 7:07 pm
by DoctorWho
You got it!
Re: Displaying the child objects of a parent drop down menu
Posted: Mon Jan 24, 2011 7:42 pm
by DoctorWho
This is what I have so far, but it's out putting the entire navigation. I just want it to out put the child objects for each section without the parent being displayed.
Code: Select all
{if $count > 0}
<ul style="margin-left: 15px; padding-left: 0;">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul> times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
<li><p><a href="{$node->url}" {if $node->target}onclick="target='newwindow'" {/if}>{$node->menutext}</a></p>
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
Re: Displaying the child objects of a parent drop down menu
Posted: Tue Jan 25, 2011 6:54 pm
by Dr.CSS
First of all you really should be using style= in your code, use CSS, second you can get the child pages quite easily by using a default combo of menu calls like it explains here...
http://multiintech.com/defaultcontent/i ... e=top_left
Re: Displaying the child objects of a parent drop down menu
Posted: Fri Jan 28, 2011 3:04 am
by DoctorWho
Thanks Dr.CSS! That's just what I was looking for!
Re: [Solved] Displaying the child objects of a drop down men
Posted: Fri Jan 28, 2011 6:36 pm
by Dr.CSS
That's why I always recommend reading all the default content as it has a lot of useful info...