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

 
hutman replied on at Permalink Reply
hutman
It sounds like the site is using the auto-nav but it might be hard coded into the template.

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.
lauraslater replied on at Permalink Reply
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
hutman replied on at Permalink Reply
hutman
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
lauraslater replied on at Permalink Reply
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:

<?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';


Not sure if that helps.
Again thank you so much!!
Laura
hutman replied on at Permalink Best Answer Reply
hutman
You will want to change

$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.
lauraslater replied on at Permalink Reply
Legend, that worked!!! Thank you so much!!
hutman replied on at Permalink Reply
hutman
Don't forget to clear the cache after you make that change.