Leftfield Posted yesterday at 05:46 AM Posted yesterday at 05:46 AM (edited) Hi @All The condition should show these nav links only to logged-in superusers, but they are still visible to guests in incognito windows and even on other devices. Cache cleared etc. <?php if ($user->isLoggedin() && $user->hasRole('superuser') && $page->editable()): ?> <li class="nav-item"><a class="nav-link px-le-2" href="<?= $page->editUrl; ?>">Edit</a></li> <li class="nav-item"><a class="nav-link px-lg-2" href="<?= $pages->get(2)->httpUrl; ?>">Admin</a></li> <li class="nav-item"><a class="nav-link px-ls-2" href="<?= $pages->get(1137)->httpUrl; ?>">Analytics</a></li> <?php endif; ?> ProcessWire 3.0.246 Edited yesterday at 05:52 AM by Leftfield
FireWire Posted yesterday at 08:15 AM Posted yesterday at 08:15 AM Perhaps give $user->isSuperuser() a shot instead. It's documented as faster and is my go-to since it's a dedicated method. 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now