show_menu2 - Display only one level of children of a selected page?

Argos

Quote from: melissa on March 31, 2010, 01:28:53 AM
The problem is that I want to hide some of the top level menu options at the top, and use images, so I have hard coded five top level menu items, and call show_menu2 for drop downs.

Try
<?php show_menu2(0SM2_ROOT+1SM2_ROOT+2SM2_ALL);
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

melissa

The problem is that I want to hide some of the top level menu options at the top, and use images, so I have hard coded five top level menu items, and call show_menu2 for drop downs.

Argos

No, you shouldn't be using different menus for each section, and you shouldn't hard code. If I understand you well, you have a menu like:
Parent 1
Parent 2
- Child 1
- Child 2
- - Child of Child 1
- - Child of Child 2
Parent 3

But you want to show only:
Parent 1
Parent 2
- Child 1
- Child 2
Parent 3

Right?

Then I think the default basic menu call should do the trick functionally:

show_menu2();
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

melissa

Hi Argos,

Thanks for replying. I've been having a go with different variables to try and get a result, as listed in my post, that's why there's nothing dropping down there. You can see:

<?php show_menu2(04SM2_ROOTSM2_ALL);

Under "In Clinic Testing". Under "What's Your Problem" is one of the four other options.

Is there something I'm not understanding about the logic of show_menu2? It seems to me that it is dependent on the page you are currently viewing. You can't tell it to display a menu for another page. Maybe I need to hardcode the whole thing.

Melissa

Argos

When I look at your site, I don't see dropdowns on "What's your problem"at all... Did you change it?
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

melissa

I have figured out a way to hide the sub level using CSS, but I'd rather like to know why show_menu2 didn't work the way I expected with SM2_START and SM2_MAX, if anyone is listening!

melissa

I am working on a site and trying to use a background image for the top level of links, and then CSS drop down menu for two pages.
http://test.wendywilliams.com.au

The two pages with drop down are "What's Your Problem" and "Free Stuff". The What's Your Problem page has 2 sublevels, but I only want to display one. I have tried a lot of different options with show_menu2, but am really struggling to see that it is possible!

Everything I have tried apart from SM2_ALL on the fourth variable displays no menu at all, and SM2_ALL displays the level I wish to hide.

<ul id="menuInner">
  <li id="whats-your-problem"><a href="/pages/whats-your-problem.php" title="What's Your Problem?"><b>What's Your Problem?</b><!--[if gte IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
  [b]<?php show_menu2(02SM2_ROOTSM2_ROOT); ?>[/b]
  <!--[if lte IE 6]></td></tr></table></a><![endif]-->
  </li>
  <li id="in-clinic-testing"><a href="/pages/in-clinic-testing.php" title="In Clinic Testing"><b>In Clinic Testing</b></a></li>
  <li id="free-stuff"><a href="/pages/free-stuff.php" title="Free Stuff"><b>Free Stuff</b><!--[if gte IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
  [b]<?php show_menu2(04SM2_ROOTSM2_ALL); ?>[/b]
  <!--[if lte IE 6]></td></tr></table></a><![endif]-->
  </li>
  <li id="about-wendy"><a href="/pages/about-wendy.php" title="About Wendy"><b>About Wendy</b></a></li>
  <li id="contact"><a href="/pages/contact-wendy.php" title="Contact"><b>Contact</b></a></li>
  </ul>


I have also tried:
<?php show_menu2(02SM2_ROOTSM2_MAX+1); ?>
<?php show_menu2(02SM2_ROOTSM2_MAX); ?>
<?php show_menu2(02SM2_ROOTSM2_START+1); ?>
<?php show_menu2(02SM2_ROOTSM2_START); ?>
All of those displayed no drop down at all.