Show memberpage when signed in only
Permalink
Hi all!
I have hidden the members page from navigation.
But I would like the members page to be visible for people that are signed in.
How can I do this?
I tried to understand the autonav php files but i give up!
I have hidden the members page from navigation.
But I would like the members page to be visible for people that are signed in.
How can I do this?
I tried to understand the autonav php files but i give up!
I tried that, the problem then was that the member link is still visible in the menu when you are signed out.
I don't want it at all unless you are signed in.
Now you see it but can´t access it.
I don't want it at all unless you are signed in.
Now you see it but can´t access it.
Maybe in your autonav block, you've checked 'Display pages to users even when those users cannot access those pages' ?
This needs to be unchecked.
This needs to be unchecked.
This might be a caching issue. Try clearing the cache.
Everything is cleared in cache settings(I have it in: Off - Good for development).
Cache cleared manually in C5 and also in browser.
Looked at the page in another browser and members was still there....
To be clear. Its the LINK in the main menu we are talking about, not the page itself.
Cache cleared manually in C5 and also in browser.
Looked at the page in another browser and members was still there....
To be clear. Its the LINK in the main menu we are talking about, not the page itself.
I am having this same issue. I only want the page visible to registered users, and the link in the nav to also only be visible to registered users. I have several pages that are working correctly, but I can't get the members page off the nav menu for guests, even though all my other private pages are off there.
I gave up on it.
If you find a sollution please post it.
I guess we could do a new autonav template and then change autonav when people are logged in.
If you find a sollution please post it.
I guess we could do a new autonav template and then change autonav when people are logged in.
The members page is treated differently in the autonav controller.
I had a look at the displayPage function of controller.php for the autonav and it appears that it doesn't check permissions for the page.
You should be able to copy /concrete/blocks/autonav/controller.php to /blocks/autonav/controller.php and edit the displayPage function, replacing it with this:
I'm assuming you're using 5.5.x here. It's probably very similar in 5.4.x though.
I had a look at the displayPage function of controller.php for the autonav and it appears that it doesn't check permissions for the page.
You should be able to copy /concrete/blocks/autonav/controller.php to /blocks/autonav/controller.php and edit the displayPage function, replacing it with this:
protected function displayPage($tc) { $tcp = new Permissions($tc); if ($tc->isSystemPage() && (!$this->displaySystemPages)) { if ($tc->getCollectionPath() == '/members' && Config::get('ENABLE_USER_PROFILES') && $tcp->canRead()) { return true; } return false; } $tcv = $tc->getVersionObject(); if ((!is_object($tcv)) || (!$tcv->isApproved() && !$this->displayUnapproved)) { return false; } if ($this->displayUnavailablePages == false) { if (!$tcp->canRead() && ($tc->getCollectionPointerExternalLink() == null)) { return false;
Viewing 15 lines of 19 lines. View entire code block.
I'm assuming you're using 5.5.x here. It's probably very similar in 5.4.x though.
Just following this up, did my suggestion work?
If so, I think I'd probably submit this as a bug fix.
If so, I think I'd probably submit this as a bug fix.
(and undo your hiding of the page)