WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • show_menu2 - Display only one level of children of a selected page?
  • Print
Pages: [1]   Go Down

Author Topic: show_menu2 - Display only one level of children of a selected page?  (Read 5826 times)

Offline melissa

  • Posts: 168
show_menu2 - Display only one level of children of a selected page?
« on: March 25, 2010, 05:31:03 PM »
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.

Code: [Select]
<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(0, 2, SM2_ROOT, SM2_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(0, 4, SM2_ROOT, SM2_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:
Code: [Select]
<?php show_menu2(0, 2, SM2_ROOT, SM2_MAX+1); ?>
Code: [Select]
<?php show_menu2(0, 2, SM2_ROOT, SM2_MAX); ?>
Code: [Select]
<?php show_menu2(0, 2, SM2_ROOT, SM2_START+1); ?>
Code: [Select]
<?php show_menu2(0, 2, SM2_ROOT, SM2_START); ?>All of those displayed no drop down at all.
« Last Edit: March 25, 2010, 05:37:24 PM by melissa »
Logged

Offline melissa

  • Posts: 168
Re: show_menu2 - Display only one level of children of a selected page?
« Reply #1 on: March 25, 2010, 06:14:17 PM »
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!
Logged

Argos

  • Guest
Re: show_menu2 - Display only one level of children of a selected page?
« Reply #2 on: March 29, 2010, 01:41:00 PM »
When I look at your site, I don't see dropdowns on "What's your problem"at all... Did you change it?
« Last Edit: March 29, 2010, 01:43:07 PM by Argos »
Logged

Offline melissa

  • Posts: 168
Re: show_menu2 - Display only one level of children of a selected page?
« Reply #3 on: March 30, 2010, 06:35:08 AM »
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:

Code: [Select]
<?php show_menu2(0, 4, SM2_ROOT, SM2_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
Logged

Argos

  • Guest
Re: show_menu2 - Display only one level of children of a selected page?
« Reply #4 on: March 30, 2010, 01:12:03 PM »
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:

Code: [Select]
show_menu2();
Logged

Offline melissa

  • Posts: 168
Re: show_menu2 - Display only one level of children of a selected page?
« Reply #5 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.
Logged

Argos

  • Guest
Re: show_menu2 - Display only one level of children of a selected page?
« Reply #6 on: March 31, 2010, 01:34:34 AM »
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
Code: [Select]
<?php show_menu2(0, SM2_ROOT+1, SM2_ROOT+2, SM2_ALL);
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • show_menu2 - Display only one level of children of a selected page?
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2