Leftfield Posted Saturday at 05:46 AM Posted Saturday 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 Saturday at 05:52 AM by Leftfield
FireWire Posted Saturday at 08:15 AM Posted Saturday 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
Leftfield Posted 10 hours ago Author Posted 10 hours ago (edited) Thanks @FireWire Heck, the same thing - default PW module for caching is keeping this URLs in navigation visible for everyone. Strange. Gonna report. Hey @ryan I didn't know where to post this prob, so I've tagged you. Sorry. Edited 10 hours ago by Leftfield
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