WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: joeyhogan on January 29, 2010, 04:13:02 AM

Title: show_menu2 - only show root and first level siblings
Post by: joeyhogan on January 29, 2010, 04:13:02 AM
Hi all!

I was wondering if anyone could give me the code for show_menu2 that will show only the root pages, and the direct siblings of the root pages, such as:

- Home
- - About Us
- - Forms
- Schools
- - High School
- - Middle School
- - North Elementary
- - East Elementary

And so on. Basically I don't want to show anything below SM_ROOT+1.

I have tried this line, but it seems to show everything:

<?php show_menu2(0, SM2_ROOT, SM2_ROOT+1,SM2_ALL); ?>

Could someone help me out? Thanks :D

Joey
Title: Re: show_menu2 - only show root and first level siblings
Post by: erpe0812 on January 29, 2010, 09:02:27 AM
Please have a look at this documents:
http://www.websitebakers.de/sm2/

rgds

erpe
Title: Re: show_menu2 - only show root and first level siblings
Post by: joeyhogan on January 29, 2010, 04:41:47 PM
Ok, I found it, thanks. Now I have one more question:

Is it possible to use the results from a show_menu2 function in a conditional statement. I have one instance of show_menu2 showing only the children of the current page, but I want to execute a different command if that page does not have any child pages.
Title: Re: show_menu2 - only show root and first level siblings
Post by: mjm4842 on August 11, 2010, 05:56:09 AM
Hi Joey,

Your question didn't really make sense.

However, try the following. I think it will help you achieve your goal.

show_menu2(0, SM2_ROOT, SM2_CURR+1, SM2_TRIM | SM2_PRETTY);
** or **
show_menu2(0, SM2_ROOT+1, SM2_CURR+1, SM2_TRIM | SM2_PRETTY);

If it doesn't help, post your code instead of asking people try to write the code for you from scratch. Also, please proof read what you write to make sure it is as clear as possible. It is confusing when you write things like "i want the siblings to be visible at all times. i only want the first level siblings to show not their child pages".

show_menu2 is an amazing tool. Each time I have a challenge, and I don't think there is any way to do it, I read the show_menu2 documentation and eventually find the solution. It may not be listed in the examples, but it's all there!

Best regards,

Michael