How do I display different content in a section based on the product tag?

Topic summary

A user wants to conditionally display different content in a Shopify section based on product tags. Specifically, they want to show special content when a product has a ‘premium’ tag and default content otherwise.

Solution provided:

  • Use Liquid’s conditional logic with {% if product.tags contains 'premium' %}
  • Place the code in either product.liquid template or within a custom section file
  • Wrap the content blocks that should change based on the tag presence

Implementation example:

{% if product.tags contains 'premium' %}
  <!-- Premium content -->
{% else %}
  <!-- Standard content -->
{% endif %}

Status: Resolved. The original poster confirmed the solution worked for their needs.

Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

I’m trying to customize one of my sections (either a custom Liquid section or a product template section) so that it displays different content based on the product tag (Checkout). For example, if a product has the tag premium, I want to show a special message or block of HTML, but if it doesn’t, it should show the default content.

I’m comfortable editing Liquid and JSON templates, but I’m not sure what the best approach is to conditionally display content based on tags within a section.

Has anyone implemented something similar? Is there a reliable way to check for a specific tag inside a section file or a block?

1 Like

You can do this directly in your section or template file like this:

{% if product.tags contains 'premium' %}
  
  
    

This is a premium product!

  

{% else %}
  
  
    

Standard product description goes here.

  

{% endif %}

Where to put this:- If you’re using product.liquid, put it in the appropriate area where content should change.

  • If you’re using a custom section, you can wrap the whole block or a part of it in the {% if %} statement.

Thanks Mate.

hey thank you for your response if you need more help feel free to share it do not forget to like