WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: margiematteson on December 21, 2008, 03:21:19 PM

Title: Showmenu help: display parent page_title if it exists else...
Post by: margiematteson on December 21, 2008, 03:21:19 PM
I'm using showmenu2 to show section menus on my site. Everything's great, except that I want to put the section title above the menu. So I tried this

show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB,
'[if(id==parent){ [page_title] }]','','','');
show_menu2(1,1,1);


Works great on the subpages, but no heading shows on the top level page.

I want something like

About Us

If I put try to test it for parent and use this code instead:

show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB,
'[if(id==parent){ [page_title] }else{ [page_title] }]','','','');


the top level works perfectly, but I get both the section title and the page title above the list on the subpages.

What am I doing wrong? I checked the documentation, but no examples are formatted like this. I know I must be close, but I can't seem to get it working.

Thank you.
Title: Re: Showmenu help: display parent page_title if it exists else...
Post by: margiematteson on March 02, 2009, 12:55:02 AM
I never did get an answer to this, but I did find a workable solution on my own. I used this code:

Code: [Select]
<?php show_menu2(0SM2_ROOTSM2_CURRSM2_CRUMB,
&
#39;[if(id==parent){ [page_title] &raquo; <br />}else{ [page_title] }]&#39;,&#39;&#39;,&#39;&#39;,&#39;&#39;); ?>
</h3>
        <?php show_menu(1,1,1,true,&#39;<li><span[class]>[a][menu_title][/a]</span>&#39;,     &#39;</li>&#39;); ?>

which results in a breadcrumb-style label for the current location. You can see this in action at www.performancedev. com. Hope this helps someone else!

If anyone knows how to get it to work as I asked in the original post, that would still be helpful, I'm sure. Thanks!