Leftfield Posted October 25 Posted October 25 (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 October 25 by Leftfield
FireWire Posted October 25 Posted October 25 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 October 27 Author Posted October 27 (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 October 27 by Leftfield
poljpocket Posted 17 hours ago Posted 17 hours ago On 10/27/2025 at 7:15 AM, Leftfield said: default PW module for caching What module are you talking about?
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