Search code examples
phpcontent-management-systempyrocms

How to implement more complex navigation in PyroCMS?


I am new to PyroCMS 2.1 - I am creating a new template and wondering how to implement the following navigation - can it be done in PyroCMS at all?

<ul id="navlist">
                <li id="nav_one"><a id="link_one" href="#">Item 1</a></li>
                <li id="nav_two"><a id="link_two" href="#">Item 2</a></li>
...
</ul>

Basically, I need a different set of ID's for each menu item (li and a elements).

Advanced navigation tag options doesn't help: http://docs.pyrocms.com/2.1/manual/index.php/modules-and-tags/tag-reference/navigation.

Thanks!


Solution

  • Doesn't look like there is a native way to do this in PyroCMS, but you can add a class to each li in the navigation section of the admin panel.

    If you do decide you really need the id's generated in your templates, you could look at extending the navigation module and widget yourself. You could update the database to include the fields you need, update the navigation module controller and models (and admin panel views) and update the widget to include the fields in the navigation variable.

    Good luck!