Menu Manager question (SOLVED)

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
starbits
Forum Members
Forum Members
Posts: 47
Joined: Tue Oct 09, 2007 9:41 pm

Menu Manager question (SOLVED)

Post by starbits »

I think I might be missing something obvious here so please let me know.
I want to create a side menu which shows the children of the current page. By itself that is easy: {menu childrenof=$page_alias} works fine.

The problem is when we get to a bottom level page, the menu is (naturally) blank. What we would like to do is show the menu from one level higher; the menu which contains the current page. We only want to do this when there are no children of the current page.

If anyone has a clue of how to begin on this please let me know.
Thanks,
Steve
Last edited by starbits on Thu Aug 11, 2011 8:04 pm, edited 1 time in total.
User avatar
kidcardboard
Forum Members
Forum Members
Posts: 54
Joined: Mon Sep 28, 2009 5:25 pm

Re: Menu Manager question

Post by kidcardboard »

Download and install CGSimpleSmarty and then use the following code.

Code: Select all

{capture assign='menu'}{menu childrenof=$page_alias}{/capture}
{if $menu != ''}
  {$menu}
{else}
  {menu childrenof=$cgsimple->get_parent_alias()}
{/if}
starbits
Forum Members
Forum Members
Posts: 47
Joined: Tue Oct 09, 2007 9:41 pm

Re: Menu Manager question

Post by starbits »

Thanks kidcardboard! I knew there was an answer. Also thanks for the tip about CGsimplesmarty - I had installed before when it was required by other modules, but never used it for itself like this. I'm glad to know what it can do.
:)
Steve
Post Reply

Return to “Modules/Add-Ons”