Menu item hidden for visitors

General discussions about WebYep
Post Reply
fld
Posts: 5
Joined: Sat Jan 29, 2011 2:02 am

Menu item hidden for visitors

Post by fld » Sat Jan 29, 2011 2:05 am

Hi,
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)?
Greets

marcus
Objective Development
Objective Development
Posts: 170
Joined: Tue Nov 30, 2010 1:25 pm

Re: Menu item hidden for visitors

Post by marcus » Mon Jan 31, 2011 2:35 pm

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.

fld
Posts: 5
Joined: Sat Jan 29, 2011 2:02 am

Re: Menu item hidden for visitors

Post by fld » Wed Mar 16, 2011 7:18 pm

Hi,
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

Post Reply