Use breadcrumbs to display categories

This commit is contained in:
Krzysztof Płaczek
2024-11-28 11:50:22 +01:00
parent 2dc4dc778d
commit bd62a23854

View File

@@ -17,7 +17,7 @@
<tr> <tr>
<td class="align-middle font-weight-bold h3"><a class="text-warning text-decoration-none" <td class="align-middle font-weight-bold h3"><a class="text-warning text-decoration-none"
href="{{ path('app_star', {'productId': product.id}) }}">{% if product.starred == true %}{% else %}{% endif %}</a></td> href="{{ path('app_star', {'productId': product.id}) }}">{% if product.starred == true %}{% else %}{% endif %}</a></td>
<td class="align-middle" style="width: 120px;"><img src='{{ product.image }}&width=70' class='border rounded p-1' alt='{{ product.name }}'/></td> <td class="align-middle" style="width: 120px;"><img src='{{ product.image }}&width=70' class='img-thumbnail' alt='{{ product.name }}'/></td>
<td class="align-middle"> <td class="align-middle">
<a href='{{ path('app_product', {'productId': product.id}) }}' class="text-decoration-none">{{ product.name }}</a> <a href='{{ path('app_product', {'productId': product.id}) }}' class="text-decoration-none">{{ product.name }}</a>
{% if product.currentStock.stock > 0 %} {% if product.currentStock.stock > 0 %}
@@ -28,11 +28,14 @@
<span class="badge text-bg-light">{{ product.subTitle }}</span> <span class="badge text-bg-light">{{ product.subTitle }}</span>
</td> </td>
<td class="align-middle"> <td class="align-middle">
<ul class='nav'>
{% for category in product.categories %} <nav aria-label="breadcrumb" style="--bs-breadcrumb-divider: '>';" >
<li class="nav-item"><a class="nav-link" href="{{ path('app_category', {'category': category}) }}"> {{ category }} </a></li> <ol class="breadcrumb">
{% endfor %} {% for category in product.categories %}
</ul> <li class="breadcrumb-item" aria-current="page"><a class="breadcrumb-item text-decoration-none" href="{{ path('app_category', {'category': category}) }}">{{ category }}</a></li></li>
{% endfor %}
</ol>
</nav>
</td> </td>
<td class="align-middle"><a href='https://pl.ryobitools.eu/{{ product.url }}'>link</a></td> <td class="align-middle"><a href='https://pl.ryobitools.eu/{{ product.url }}'>link</a></td>
<td class="align-middle">{{ product.price.last.price | format_currency('PLN', {}, 'pl') }}</td> <td class="align-middle">{{ product.price.last.price | format_currency('PLN', {}, 'pl') }}</td>