Dawn theme - have ICON WITH TEXT shown only when metafields is used

Topic summary

A user wants to display the “Icons With Text” section on product pages in the Dawn theme, but only when specific metafields are populated—not on all products.

Proposed Solution:

  • Use conditional Liquid code to check metafield values before rendering the section
  • Wrap the Icons With Text section code with template and metafield value checks
  • Example structure: {% if template.name contains 'product' %} followed by {% if product.metafields.custom.demo_field.value == "your value" %}

Implementation Options:

  • Create a new custom section specifically for this conditional display
  • Modify the existing section code to include the conditional logic

The solution allows selective display based on whether the metafield contains the expected value, giving control over which products show the icon section.

Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

How can I use the Icons With Text section on the product pages using Metafields? I only want to use it on some products, not all!

Thanks

Hello @xnyjyh , You have to make a conditional code for it to check its value of the metafield. Try the code below.

{% if template.name contains 'product' %}
 {% if product.metafields.custom.demo_field.value == "your value" %}
   // your code of that section //
 {% endif %}
{% endif %}

// Try to put this code with make a new custom section for this or else go with your existing section file //

Feel free to reach out if you have any questions or need assistance.

Best regards.