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

show_menu2: valid XHTML and CSS selectable menus

<< < (6/64) > >>

rabsaul:

--- Quote from: ruebenwurzel on February 28, 2006, 12:35:30 PM ---Hello,

this snippet seems what you need. Looked at the link you posted above. You have a horizontal menu wich should only show the root level. This you got in your template with <?php show_menu2(1, SM2_ROOT, SM2_START); ?>. And the menu on your right side wich shows all pages you got with <?php show_menu2(); ?>.

The Layout you define in the screen.css. Your existing one should work without changes. (not shure, done only a short look on it)

Matthias

--- End quote ---
Thanks, Matthias... the thing is that this is hard-coded, and I want *only* those particular links you see there, not every page that gets created at the root level. Make sense? Will this still work somehow?

ruebenwurzel:
Hello,

There is a ability to only show menus using the page_id, but I'm not shure if it's possible to define more then one page_id. Please ask brofield.

Matthias

brofield:

--- Quote from: rabsaul on February 28, 2006, 10:56:51 AM ---Is there a way I can work with this code snippet to provide an "on state" for links I'm "hard-coding" into the template?

--- End quote ---

If I understand you correctly:

* you have a fixed set of menu items that you want displayed in the top menu bar
* you want to highlight the current page in that menu but can't at moment as using hardcoding
* you don't want to display all top level menu items as it may change
As ruebenwurzel suggested, use a fixed parent for the menu.

* Create a menu item and set it to invisible, this is the parent. See the admin URL for the page ID of this page, you will use it later.
* Create the menu items in it for the top of the page below it. Use the MenuLink type. These children are visible.
This menu won't show normally because of the invisible parent. However, you can show it in your template where-ever you want by specifying the ID of the invisible parent:
<?php show_menu2(1, **INVISIBLE_PAGE_ID**, SM2_ALL, SM2_ALL); ?>

Style it using CSS:
.menu-current { font-weight: bold; }

The menu "Hidden Menu" at the demo site (see main post for URL) uses this technique.

Cheers,
Brodie

rabsaul:
Thanks, Brodie.

Oops, I should have come back to this thread and mentioned that I had got another solution:

http://forum.WebsiteBaker.org/index.php/topic,2652.0.html

As you'll see from the above, the only problem I'm having is the home page. I haven't figured out the PageName call for it, since it's being "redirected." I've tried, welcome, index, default, home, default_page, default_link etc. No luck yet.

tim

kweitzel:
when you mean homepage, do you actually mean the intro page? Then you would find it is named "intro.php".

Otherwise the first page in your structure of created pages (normally the hompage) has pageid 0. But I think you mean the intropage. This is a static page and not in the DB.

cheers

Klaus

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version