Skip to content

Commit

Permalink
Fix blog meta category and tag classname (#730)
Browse files Browse the repository at this point in the history
Use automated and required and recognizable "slug" instead of empty "count".
  • Loading branch information
wesleyboar authored Apr 23, 2023
1 parent 33e455d commit 3cb922c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changes/710.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add classname for categories and tags that uses slug, not empty "count".
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
{% if post.categories.exists %}
{% for category in post.categories.all %}
{% if category.slug %}
<li class="category_{{ forloop.counter }}"><a href="{% url 'djangocms_blog:posts-category' category=category.slug %}" class="blog-categories-{{ category.count }}">{{ category.name }}</a>{% if not forloop.last %}, {% endif %}</li>
<li class="category_{{ forloop.counter }}"><a href="{% url 'djangocms_blog:posts-category' category=category.slug %}" class="blog-categories-{{ category.count }} blog-categories-{{ category.slug }}">{{ category.name }}</a>{% if not forloop.last %}, {% endif %}</li>
{% endif %}
{% endfor %}
{% endif %}
{% if post.tags.exists %}
{% for tag in post.tags.all %}
<li class="tag_{{ forloop.counter }}"><a href="{% url 'djangocms_blog:posts-tagged' tag=tag.slug %}" class="blog-tag blog-tag-{{ tag.count }}">{{ tag.name }}</a>{% if not forloop.last %}, {% endif %}</li>
<li class="tag_{{ forloop.counter }}"><a href="{% url 'djangocms_blog:posts-tagged' tag=tag.slug %}" class="blog-tag blog-tag-{{ tag.count }} blog-tag-{{ tag.slug }}">{{ tag.name }}</a>{% if not forloop.last %}, {% endif %}</li>
{% endfor %}
{% endif %}
</ul>

0 comments on commit 3cb922c

Please sign in to comment.