Skip to content

Commit c02b130

Browse files
authored
add categories macro
1 parent aa663b0 commit c02b130

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Resources/themes/default/macros.twig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,18 @@
159159
{% endif %}
160160
{% endmacro %}
161161

162+
{% macro categories(reflection) %}
163+
{% if reflection.hasCategories() %}
164+
<p>
165+
{% for categoryTag in reflection.getCategories() %}
166+
{% for category in categoryTag %}
167+
<span class="label label-default">{{ category }}</span>
168+
{% endfor %}
169+
{% endfor %}
170+
</p>
171+
{% endif %}
172+
{% endmacro %}
173+
162174
{% macro todo(reflection) %}
163175
{% if project.config('insert_todos') == true %}
164176
{% if reflection.todo %}<small><span class="label label-info">{% trans 'todo' %}</span></small>{% endif %}

0 commit comments

Comments
 (0)