Show "slug" category in Post:
{{ post.categories[0].slug }}
But, how to add this "slug" to 'activeMenuItem'?
function onInit()
{
$this['activeMenuItem'] = ???;
}
Thanks!
UPD, for use here:
{% for item in items %}
<a href="{{ item.url }}">
<span class="{{ item.isActive or item.isChildActive ? ' active' : '' }}">{{ item.title }}</span>
</a>
{% endfor %}
function onEnd() {
$this['activeMenuItem'] = $this->post->categories[0]->slug;
}