M
M
MaxQw2021-08-10 23:28:13
OctoberCMS
MaxQw, 2021-08-10 23:28:13

How to assign Blog plugin categories to activeMenuItem function?

OctoberCms 473, plugin Blog 1.5.2 .

A small problem, tell me how to assign the slug of the Blog plugin categories to the activeMenuItem function (instead of test, respectively):

function onInit() {
$this['activeMenuItem'] = 'test';
}


And maybe someone needs it, the blog categories themselves (id, slug, name) can be displayed in the post like this:

{{ post.categories[0].id }}
or
{% for cat in post.categories %}
  {{ cat.id }}
{% endfor %}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question