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

Check if page had subpages, and then show a submenu

(1/2) > >>

Gerben de G.:
I want to have a submenu on my website, but only on pages who really have subpages. How can i check this?

-BTW, sorry for my bad Enlgish

Stefek:
Took you allredy a look at the show_menu2() function?

Stefek

BerndJM:
Hi Gerben,

don't worry about your English, the mine isn't better  :|

To answer your question, some details would be helpful:
- what WB version you use?
- what template you use / would like to use?
- what a menu-call is in this template: show_menu() - show_menu2() - a "hand-made" menu?

So the answer could be:
- take this or that parameter in your menu-call or
- change this or that code part in your template
- ...

You see: no "good" information == no "good" answers ;-)

Regards Bernd

Gerben de G.:
Ok, thanx for comments.

@BerndJM:
Som extra Information:
WB 2.7
Own template
at the moment i use show_menu().

Soon as possible i will take a look at show_menu2(). Maybe is that a good way.

Gerben

BerndJM:
Hi,
using SM2 is the easiest way to realize what you want:

For the main menu:

--- Code: ---show_menu2(0, SM2_ROOT, ... other parameters depending on your needs)
--- End code ---
for the submenu:

--- Code: ---show_menu2(0, SM2_ROOT+1, ... other parameters depending on your needs)
--- End code ---
So the submenu is only visible if you are on a page with subpages.

Regards Bernd

Navigation

[0] Message Index

[#] Next page

Go to full version