coderedcms icon indicating copy to clipboard operation
coderedcms copied to clipboard

Get all selected classifiers in an article

Open pascalthivierge opened this issue 4 years ago • 1 comments

I would like to get the classifier terms that are selected in an article. How can I achieve this?

pascalthivierge avatar Aug 28 '20 07:08 pascalthivierge

page.classifier_terms will give you a ManyToMany containing all of the classifier terms of that page. So in your template you could do something like:

{% for term in page.classifier_terms.all %}
<span>{{ term.name }}</span>
{% endfor %}

vsalvino avatar Aug 28 '20 15:08 vsalvino