How can I display a section only on specific sub-pages?

Hi, I would like to display a section on certain pages only.

Usually, I will use the following code to display on certain collections, eg;

{% if collection.handle == "components" %} 
--- my content---
{% endif%}

However, how do I display when I want the content to be on the sub-page of the collection?

Example: https://giant-bicycles.com.sg/collections/components/saddle

Hi @seantay1993 ,

You can try to use this code

{% if template contains 'componets' %}

{% endif %}

Hi, I want the section to appear on the sub-category of the collection page instead, meaning the “saddle” instead for all the sub-categories of the collection “components”.

You can try this one

{% if collection.title == 'Saddle' %}

{% endif %}

It does not work for me. Thanks :slightly_smiling_face:

Try this one

{% if collection.url == 'saddle' %}
{% endif %}

It still doesn’t work. The “saddle” is a tag, will be code any related to tag?

Got my solution. Thanks.

{% if collection.tags contains 'saddle' %}
--- content---
{% endif%}