Navigation not showing on certain pages.

Permalink 1 user found helpful
Still wrapping my head around how things are done in Concrete5.

I'm turning a design into a theme. On pages which are constructed with "view.php" the main navigation doesn't show, pages like blog search and blog posts (blogga).

Without view.php those pages have no css applied and no html so I know view.php is controlling it.


I have separated the HTML code into default.php, header.php and footer.php. I'm simply not clear as to why the navigation won't show on certain pages.

Appreciate the help. (a couple of images below)

2 Attachments

mckinstry
 
TheRealSean replied on at Permalink Best Answer Reply
TheRealSean
There are a couple of ways you can call the auto-nav directly from your header file,

$bt_main = BlockType::getByHandle('autonav');
$bt_main->controller->displayPages = 'top'; //top|second_level|custom
//if custom set the id to appear under
//$bt_main->controller->displayPagesCID = $pageID;
$bt_main->controller->orderBy = 'display_asc';                    
$bt_main->controller->displaySubPages = 'none';
$bt_main->controller->displaySubPageLevels = 'none';
$bt_main->render('templates/header_menu');//or your custom template "() "for default


Your other option, my preferred method is to use a global block from the scrap book,
Create an Autonav and rename it header_navigation
then use the following
$block = Block::getByName('header_navigation');
if( $block && $block->bID ) $block->display();


This method allows you to change the options in the scrapbook from the dashboard the first is a little more hard coded.

Also these methods will not use the custom css (from view.css if using a custom template) you would need to add that to your main.css

If you add that to your header then that will be included in your view.php and throughout the site

Regards
Sean
mckinstry replied on at Permalink Reply
mckinstry
Awesome, seems to be exactly what I'm after.

I'll try this later today, appreciate the reply.

Tim
mshores replied on at Permalink Reply
Super helpful! Thank you very much.

Michael