Page with permissions to appear in the Nav Bar
Permalink
Hello
I am building a hub/intranet page with permissions (only certain logged in users can access this page) for a client and i need the link to appear in the nav bar even when the user is not logged in.
Does any one know how I can do this please?
I am not using Auto nav, I assume it's hard coded (i didn't build this site but for example, when i add a new page to the site it automatically appears in the nav bar.)
Extremely grateful for any advice!
Thank you
Laura
I am building a hub/intranet page with permissions (only certain logged in users can access this page) for a client and i need the link to appear in the nav bar even when the user is not logged in.
Does any one know how I can do this please?
I am not using Auto nav, I assume it's hard coded (i didn't build this site but for example, when i add a new page to the site it automatically appears in the nav bar.)
Extremely grateful for any advice!
Thank you
Laura
Thank you for your reply!
How do i let you know how the pages are showing up? (Sorry a bit of a novice when it comes to hard coded items!). The nav bar i'm referring to is on this sitehttp://www.actionplanning.co.uk
Thanks again
Laura
How do i let you know how the pages are showing up? (Sorry a bit of a novice when it comes to hard coded items!). The nav bar i'm referring to is on this sitehttp://www.actionplanning.co.uk
Thanks again
Laura
I am guessing that this will be in the header.php of your theme but it appears you have a fully custom theme so there is really no way for us to tell what file it would be in. Your theme lives in /packages/knibbs/themes/knibbs
Ah yes, it is a customised theme.
I've just opened up the nav.php as this is where the nav appears to be created. The code is as follows:
Not sure if that helps.
Again thank you so much!!
Laura
I've just opened up the nav.php as this is where the nav appears to be created. The code is as follows:
<?php defined('C5_EXECUTE') or die("Access Denied."); ?> <nav id="horizontal-nav" role="navigation"> <div class="knibbs-container" id="knibbs-container"> <div class="knibbs-button"> <div class="nav-text">MENU</div> <div class="nav-icon"><span class="knibbs-bar"></span><span class="knibbs-bar"></span><span class="knibbs-bar"></span></div> </div> <div id="menu" class="menu" style="display:none;"> <div class="knibbs-button"> <div class="nav-icon"><i class="fa fa-times"></i></div> </div> <?php $autonav = BlockType::getByHandle('autonav'); $autonav->controller->orderBy = 'display_asc'; $autonav->controller->displayPages = 'top';
Viewing 15 lines of 27 lines. View entire code block.
Not sure if that helps.
Again thank you so much!!
Laura
You will want to change
to
That additional line sets the "Display links that may require login." to true.
$autonav = BlockType::getByHandle('autonav'); $autonav->controller->orderBy = 'display_asc'; $autonav->controller->displayPages = 'top'; $autonav->controller->displaySubPages = 'all'; $autonav->controller->displaySubPageLevels = 'all'; $autonav->render('templates/default_nav');
to
$autonav = BlockType::getByHandle('autonav'); $autonav->controller->orderBy = 'display_asc'; $autonav->controller->displayUnavailablePages = 1; $autonav->controller->displayPages = 'top'; $autonav->controller->displaySubPages = 'all'; $autonav->controller->displaySubPageLevels = 'all'; $autonav->render('templates/default_nav');
That additional line sets the "Display links that may require login." to true.
Legend, that worked!!! Thank you so much!!
Don't forget to clear the cache after you make that change.
In order to help we will need to know how the pages are showing up, this changes how you would go about making the adjustment.