Hard-code Accordion Menu into my template

Permalink Browser Info Environment
I'm looking to put the AM code into certain templates so that my clients don't need to do it through C5 each time. I've figured out how to get it to work with the default C5 autonav using this method ...http://www.concrete5.org/community/forums/customizing_c5/how_to_aut...

The problem obviously is that I cannot figure out how to incorporate the AM view with this hard coding method.

Type: Discussion
Status: Resolved
nosfan1019
View Replies:
ChrisWatterston replied on at Permalink Reply
ChrisWatterston
It is quite simple, first you need to copy the folder 'autonav' (located within /accordion_menu/blocks/) into the root 'blocks' folder of your website.

Then you need to add your hard menu code into your template and specify what style of template to use. Below I have given an example of an embedded accordion menu using the template 'accordion_menu_black'.

<?php 
   $bt_main = BlockType::getByHandle('autonav'); 
   $bt_main->controller->displayPages = 'top';
   $bt_main->controller->orderBy = 'display_asc';
   $bt_main->controller->displaySubPages = 'all';
   $bt_main->controller->displaySubPageLevels = 'all';
   $bt_main->render('templates/accordion_menu_black/view');
?>


Hopefully this will answer any questions you have.

Thanks a lot,
Chris Watterston

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.