Page 1 of 1

Menu item hidden for visitors

Posted: Sat Jan 29, 2011 2:05 am
by fld
Is there a solution for hidding a menu-item for visitors (=so they can't go on that page), and when you login the menu-item appears (=and the admin can acces that page)?

Re: Menu item hidden for visitors

Posted: Mon Jan 31, 2011 2:35 pm
by marcus
I'm afraid, this isn't possible - at least not with a menu item.

There is a way to do it, but it will depend on your needs, whether you can use it or not.
Simply place a link to the "secret page" on your site and wrap it with the following code:

Code: Select all

<?php if (webyep_bIsEditMode()) { echo "

<a href='./link_to_your_secret_page.php'>Admins Corner</a>

"; } ?>

This way, WebYep will only display the link, if an admin is logged in. The first and last lines would do the trick of hiding everything between the quotes. You can place everything in there, not only a link like in the example, but be careful with the quotes: if you want or have to use double quotes in your "hidden" HTML, you'll have to escape them.

Re: Menu item hidden for visitors

Posted: Wed Mar 16, 2011 7:18 pm
by fld
Is there also a solution that when a multilogon is logged in, he doesn't see this link?
So that this link is only visible when the Admin is logged in? Because now, when I login whit a multilogon, i can still see this secret link.

Many thanks