Add code to current menu item
Permalink 1 user found helpful
Hi all,
I'm new to concrete5 and just started converting a HTML template to a c5 theme. The problem that i'm having is that the template requires next to the <a> tag of the current menu item.
So you would get:
Instead of just the link.
Anyone know how this can be achieved? Thanks in advance!
I'm new to concrete5 and just started converting a HTML template to a c5 theme. The problem that i'm having is that the template requires
<span></span>
So you would get:
<a class="nav-selected nav-path-selected" href="#">Home</a><span></span>
Instead of just the link.
Anyone know how this can be achieved? Thanks in advance!
I've written a detailed walk-through of how to customize the autonav template (including a better template that is much easier to work with than what's included in C5):
http://c5blog.jordanlev.com/blog/2011/12/customizing-the-autonav-te...
http://c5blog.jordanlev.com/blog/2011/12/customizing-the-autonav-te...
Thanks guys, it works!
You can override the "view.php" file for the auto-nav block by copying the view.php file from /concrete/blocks/autonav/view.php and put it in /blocks/autonav/templates/my_custom_template_name/view.php.
Then make the changes so that the currently selected link has the <span></span> added to it.
Then while in edit mode, you can click on the autonav block and choose "Custom Template", you'll see "my_custom_template_name" in the drop-down list. Select it and you'll have your span tag added.
If you've inserted the autonav programmatically, then you "call" your custom template with
my_custom_template_name should be descriptive of your custom template, you cannot have spaces - use underscores instead.