get_page_classifiers.rst 571 B

1234567891011121314151617181920212223
  1. Get Classifier Terms for Pages in a Template
  2. ============================================
  3. You can include your classifier terms for your pages in your template with code similar
  4. to the below:
  5. .. code-block:: Django
  6. {% for term in page.classifier_terms.all %}
  7. <span>{{ term.name }}</span>
  8. {% endfor %}
  9. If you only want to show specific terms, you can do something like this:
  10. .. code-block:: Django
  11. {% for term in page.classifier_terms.all %}
  12. {% if term.slug=="the-term-slug" %}
  13. <span>{{ term.name }}</span>
  14. {% endif %}
  15. {% endfor %}