Jump to content

Editable page


Marco Angeli
 Share

Recommended Posts

Hi there,

we all use this:

		<?php 

	// If the page is editable, then output a link that takes us straight to the page edit screen:
	if($page->editable()) {
		echo "<a class='nav' id='editpage' href='{$config->urls->admin}page/edit/?id={$page->id}'>Edit</a>"; 
	}

	?>

Unfortunately, I always see the edit link, even if I'm  logged out...

Very strange...recently I switched from test mode in a sub-domain (new.mysite.com) to production mode (www.mysite.com).

Could this be an issue?

Link to comment
Share on other sites

Have you tried:

    if($page->editable()&& $user->isLoggedin()) { // also check if the user is currently logged in
        echo "<a class='nav' id='editpage' href='{$config->urls->admin}page/edit/?id={$page->id}'>Edit</a>";
    }

to make a double check that the current user is logged in?

  • Like 1
Link to comment
Share on other sites

$user->isLoggedin() shouldn't be necessary here as $page->editable() already checks for various permission etc.

So maybe do you have the guest role given page edit access? What happens if you click the link?

Well I'm waiting for a facepalm here cause it's not possible.

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...