WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: weiry on February 25, 2009, 01:48:15 AM

Title: Menu link inside index.php
Post by: weiry on February 25, 2009, 01:48:15 AM
Hi,

Is there a way to include a menu link inside the index.php file? I have created a menu link to the WB backend once a user logs in through the front end. The page is private so it shows up once they login. However, I don't want to include this in the menu bar, I want to include it in the side column, underneath the Login box once they have logged in.

Anyone?
Title: Re: Menu link inside index.php
Post by: marathoner on February 25, 2009, 04:36:02 AM
You could do something like this in your template beneath the login (code not verified)

Code: [Select]
if ($wb->get_session('GROUP_ID')==1) {
echo "<h2><a href=\"" . ADMIN_URL . "/index.php\">Admin</a></h2>;";
}
Title: Re: Menu link inside index.php
Post by: ruebenwurzel on February 25, 2009, 06:51:08 AM
Hello,

use different menues and set the privat page to your "second" menu wich you then can call in your sidebar.

http://help.WebsiteBaker.org/pages/en/advanced-docu/designer-guide/multiple-menus.php (http://help.WebsiteBaker.org/pages/en/advanced-docu/designer-guide/multiple-menus.php)

Matthias
Title: Re: Menu link inside index.php
Post by: weiry on February 26, 2009, 01:03:05 AM
Both great suggestions.

Matthias, I did think about using a second menu, but didn't want to go to that extent, just for one page. If I had more pages that were Private then this would be a perfect solution and I will use it when that case arises.

Marathoner, code excellent. Just missing the php tags from and end and one too many of these ";" after the </h2> tag, but perfect!

Thank you both for your time. :-)