WebsiteBaker Support (2.8.x) > Templates, Menus & Design

show_menu2: valid XHTML and CSS selectable menus

<< < (39/64) > >>

lleighh2:
I'm sorry but I'm just not getting this mod.

I've read through most of this thread and the jellycan sm2 documentation but i'm not a programmer so I just cook book it and copy what works for others.

So far I've been able to cook this up for my top horizontal menu here: http://www.theprocess.com/dev/wb//pages/rates.php.

Okay, I was really happy when I got the mod to show that. Trouble is this isn't what i want. I want the top menu to show a submenu of children only. Not a repeat of the main menu.  Please just alter my code below so that I can just copy it in place.


--- Code: ---<?php show_menu2(0, SM2_ROOT, SM2_CURR+1, &#39;&#39;,&#39;[if(class!=menu){[a][menu_title]</a>}]&#39;,&#39;&#39;,&#39;&#39;,&#39;&#39;); ?>
--- End code ---

Here's a page that contains the submenu that i want to appear when you're on the voice talent page only:
http://www.theprocess.com/dev/wb//pages/female-voice-talent.php

I'm in the process of building the site. At least three other pages will have a unique submenu at the top.

brofield:
Probably what you want. Lifted verbatim from the examples site:
http://code.jellycan.com/sm2test/

Root Level Only
show_menu2(0, SM2_ROOT, SM2_START);

Children/Siblings
This is often used when splitting menus between the root menu and a side menu showing the children of the current page. This menu will show all of the children of the current top level menu, but will continue to display the siblings of child pages as well when a lower level menu is selected.
show_menu2(0, SM2_ROOT+1, SM2_CURR+1);

Probably what you do NOT want. Anything that has [if...] embedded in it.

Have fun.

lleighh2:

--- Quote from: brofield on August 24, 2007, 01:30:28 AM ---Probably what you want. Lifted verbatim from the examples site:
http://code.jellycan.com/sm2test/

Root Level Only
show_menu2(0, SM2_ROOT, SM2_START);

Children/Siblings
This is often used when splitting menus between the root menu and a side menu showing the children of the current page. This menu will show all of the children of the current top level menu, but will continue to display the siblings of child pages as well when a lower level menu is selected.
show_menu2(0, SM2_ROOT+1, SM2_CURR+1);

Probably what you do NOT want. Anything that has [if...] embedded in it.

Have fun.

--- End quote ---

I've been looking over that jelly can site for literally hours and made no sense of it. I'm sorry, just not structured in a way that worked for me.

I changed my code to this:

--- Code: ---show_menu2(0, SM2_ROOT+1, SM2_CURR+1)
--- End code ---
... just like you said but I only get the children to show in the left side menu not at the top like I want them.

... EDIT ...
Hold the phone! I just discovered that part of the problem was that I had the submenu items set to something other than the Main menu. So now, I'm very close. I'll keep tinkering.

Thanks for your help!!

lleighh2:
Don't mean to be a pest/hog but i'm on a tight turnaround.

How do i pull my menu-current class from my css? It places a bg image behind the current menu item.

This is what I have so far:

--- Code: ---<?php show_menu2(0, SM2_ROOT, SM2_START, 

&#39;<ul>&#39; , &#39;<li class="menu">[a][menu_title]</a>&#39;, &#39;</li>&#39; , &#39;</ul>&#39;, &#39;&#39;, &#39;&#39;); ?>    
--- End code ---

brofield:
Why do you think that I should care what sort of turnaround you are on.

I've already spent uncounted hours writing decent documentation and samples. Look at these things that have been written before. Play with parameters and look at what HTML source is generated by the function if you can't figure it out otherwise (try using the SM2_PRETTY flag to make it easier to read). Use your own initiative and not my time.

<style type="text/css"> .menu-current { background: url(big-arse-picture); } </style>
<?php show_menu2(0, SM2_ROOT, SM2_START); ?>

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version