Hi there. I’m quite new to both EE and PHP. I’m about to program a three-level-menu site, where I hardcoded the first level in the index files of the different template groups (e.g. »Services« / »About us« and so on).
Both the second and the third level run with the cat_expand-plugin, category groups corresponding to the first level menu items with their (sub-)categories assigned to weblog entries.
The first level is hardcoded, because it’s horizontal on the top of the page and the two other levels are on the left side which doesn’t work with the plugin. This is not such a big problem because the different first level menu items have to have their designated templates anyway.
To highlight the first level is no problem because it’s hardcoded, but how should I do this on the other two levels? The plugin serves a certain »active-style«-command, but that only wraps a div around the a-tag and can’t include a CSS-class to the a-tag and also it does this only for the present (sub-)category, but not its parent category. Should I rather change something in the plugin PHP or can I do this with some conditionals in the following template code? Or is the cat_expand_plugin the wrong way for this use in the first place? Creating new templates for every navigational state in all sublevels seems a bit unnecessary to me in a CMS …
Thanks for any help!
<div id="subnav">
{exp:cat_expand:wrapper}
{exp:weblog:categories root_node="8"}
{exp:cat_expand:expander category="{category_id}"}
<a href="http://{path=template_group}">{category_name}</a>
{/exp:cat_expand:expander}
{/exp:weblog:categories}
{/exp:cat_expand:wrapper}
</div>