show_menu2 - only show root and first level siblings

mjm4842

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
Frustrated? Spending too much time developing when all you really want is a working website? Contact me directly if I can be of services to you.
___________________________


www.tngconsulting.ca

joeyhogan

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.


joeyhogan

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