Page 1 of 1

Menu Manager question (SOLVED)

Posted: Tue Aug 02, 2011 11:09 pm
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

Re: Menu Manager question

Posted: Thu Aug 11, 2011 4:44 pm
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}

Re: Menu Manager question

Posted: Thu Aug 11, 2011 8:03 pm
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