Skip to content

Commit

Permalink
fix: add dynamic category classes to blog card component
Browse files Browse the repository at this point in the history
  • Loading branch information
7underlines committed Dec 31, 2024
1 parent 32380a3 commit 0977f2d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{% block werkl_blog_card %}
<article class="card blog-card">
{% set categoryClasses = '' %}
{% if article.blogCategories.elements|length > 0 %}
{% set categoryClasses = article.blogCategories.elements|map(c => 'blog-category-' ~ c.id)|join(' ') %}
{% endif %}
<article class="card blog-card {{categoryClasses}}">
{% block werkl_blog_card_teaser_image %}
<a href="{{ seoUrl('werkl.frontend.blog.detail', {'articleId': article.id}) }}"
title="{{ article.translated.title }}"
Expand Down

0 comments on commit 0977f2d

Please sign in to comment.