我有代码,可以根据需要显示1-3级-显示第4级需要什么?
(1)/展览(2)/过去(3)/ 2019(4?)/ https://www.waterstreetgallery.co.uk/en/exhibitions/past/2019/
为该类别添加了图片,我尝试使用{% for sub in **sub**subCat.subs %}
,但没有任何乐趣。
<!-- 1stlevel -->
{% for category in shop.categories %}
{% if category.id == collection.category_id and category.subs %}
<div class="parenter grid-cell mb3 {% if category.url == exhibitions %}exhibitionsGrid{% endif %}">
<div class="grid column-orient">
<div class="grid-cell">
<div class="grid wrap col-filtered relative">
{% for sub in category.subs %}
{% if sub.image %}
<div class="grid-cell grow0 col-products_product already-visible come-in">
<div class="subcatimage">
<a href="{{ sub.url | url }}">
<img class="image" src="{{ sub.image | url_image() }}">
<div>{{ sub.title | t }}</div>
</a>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
</div>
{% endif %}
{% endfor %}
<!-- 1stlevel -->
<!-- 2nd/3rdlevel -->
{% set collectionTitle = collection.internal.url | split('/') %}
{% if collectionTitle[1] %}
{% for category in shop.categories %}
{% for subCat in category.subs %}
{% if subCat.id == collection.category_id and subCat.subs %}
<div class="parenter grid-cell mb3 {% if category.url == exhibitions %}exhibitionsGrid{% endif %}">
<div class="grid column-orient">
<div class="grid-cell">
<div class="grid wrap col-filtered relative">
{% for sub in subCat.subs %}
{% if sub.image %}
<div class="grid-cell grow0 col-products_product already-visible come-in">
<div class="subcatimage">
<a href="{{ sub.url | url }}">
<img class="image" src="{{ sub.image | url_image() }}">
<div>{{ sub.title | t }}</div>
</a>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
</div>
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
<!-- 2nd/3rdlevel -->
已将正确的代码添加到collection.rain,该类别的图片将在以下页面上显示- https://www.waterstreetgallery.co.uk/en/exhibitions/past/2019/February-March/
这里
https://www.waterstreetgallery.co.uk/en/exhibitions/past/2019/
在此先感谢您的帮助