WebsiteBaker Community Forum (upd)

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: Gerben de G. on August 05, 2008, 08:13:52 PM

Title: Check if page had subpages, and then show a submenu
Post by: Gerben de G. on August 05, 2008, 08:13:52 PM
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
Title: Re: Check if page had subpages, and then show a submenu
Post by: Stefek on August 06, 2008, 02:19:39 AM
Took you allredy a look at the show_menu2() function?

Stefek
Title: Re: Check if page had subpages, and then show a submenu
Post by: BerndJM on August 06, 2008, 03:29:13 AM
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
Title: Re: Check if page had subpages, and then show a submenu
Post by: Gerben de G. on August 06, 2008, 04:27:54 PM
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
Title: Re: Check if page had subpages, and then show a submenu
Post by: BerndJM on August 06, 2008, 04:38:56 PM
Hi,
using SM2 is the easiest way to realize what you want:

For the main menu:
show_menu2(0, SM2_ROOT, ... other parameters depending on your needs)
for the submenu:
show_menu2(0, SM2_ROOT+1, ... other parameters depending on your needs)
So the submenu is only visible if you are on a page with subpages.

Regards Bernd
Title: Re: Check if page had subpages, and then show a submenu
Post by: Gerben de G. on August 20, 2008, 09:16:52 PM
Little bit late, but it works.
Thanks!
Title: Re: Check if page had subpages, and then show a submenu
Post by: rikkibr on December 22, 2008, 05:42:28 PM
Thanks Bernd  :-)

This solved my problem also.