[Solved] Displaying the child objects of a drop down menu

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
DoctorWho
Forum Members
Forum Members
Posts: 34
Joined: Mon Jan 24, 2011 5:14 pm

[Solved] Displaying the child objects of a drop down menu

Post 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:
Last edited by DoctorWho on Fri Jan 28, 2011 7:08 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Displaying the child objects of a parent drop down menu

Post by Dr.CSS »

Are you wanting the child pages of the active top menu item to be displayed on the left side?...
DoctorWho
Forum Members
Forum Members
Posts: 34
Joined: Mon Jan 24, 2011 5:14 pm

Re: Displaying the child objects of a parent drop down menu

Post by DoctorWho »

You got it!
DoctorWho
Forum Members
Forum Members
Posts: 34
Joined: Mon Jan 24, 2011 5:14 pm

Re: Displaying the child objects of a parent drop down menu

Post 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}
Last edited by DoctorWho on Fri Jan 28, 2011 7:07 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Displaying the child objects of a parent drop down menu

Post 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
DoctorWho
Forum Members
Forum Members
Posts: 34
Joined: Mon Jan 24, 2011 5:14 pm

Re: Displaying the child objects of a parent drop down menu

Post by DoctorWho »

Thanks Dr.CSS! That's just what I was looking for!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: [Solved] Displaying the child objects of a drop down men

Post by Dr.CSS »

That's why I always recommend reading all the default content as it has a lot of useful info...
Post Reply

Return to “CMSMS Core”