Shopify themes, liquid, logos, and UX
IM trying to get the Icon With Text section to show only on certain products. But I'm unable to find tutorials for the is. Anyone have a tutorial on this topic?
Thanks
Solved! Go to the solution
This is an accepted solution.
You can add a metafields for a product and then add text to the metafields input box on the product page.
Then add Icon with Text to the product. Then the textbox uses the added metafields
Hello, @xnyjyh
Your requirements should require custom code.
You're kidding me, right?! that's your answer?... maybe you need to read my question, again...
So if you need, I can help you customize the code directly. Your requirements are not detailed, so it's impossible to tell you the code directly.
This is the "if"
{%- if product.metafields.custom.show_unisex == true -%}
{%- endif -%}
This is the code in the icon with text .liquid I need to apply it to.
{%- unless heading_1_empty -%}
<li class="icon-with-text__item">
{%- if block.settings.image_1 == null -%}
{%- render 'icon-accordion', icon: block.settings.icon_1 -%}
{%- else -%}
<img
src="{{ block.settings.image_1 | image_url }}"
{% if block.settings.image_1.alt != blank %}
alt="{{ block.settings.image_1.alt | escape }}"
{% else %}
role="presentation"
{% endif %}
height="auto"
width="auto"
loading="lazy"
>
{%- endif -%}
<span class="h4 inline-richtext">
{{- block.settings.heading_1 -}}
</span>
</li>
{%- endunless -%}
I only need this icon and text section to show when I select true or false metafield in products setup pages. Do not want it to show on all products. Hope that makes sense.
This is an accepted solution.
You can add a metafields for a product and then add text to the metafields input box on the product page.
Then add Icon with Text to the product. Then the textbox uses the added metafields
It wouldnt work that way. I need to be able to hide or unhide or move the icon with text section on the default product page in site builder
Why doesn't it work? I should have understood your needs correctly.
I added a metafields and added text to the metafields input box on the product page
This product displays icons and text.
Product pages without added text do not display icons and text
Maybe i not understanding. So with the metaield tag I have that I made in the metafields section (product.metafields.custom.show_unisex). i do not need this?
Can you elaborate a little please. thanks
Figured it out. Ive done few metafields, but never this way before, thanks! 🙂
I have the same issue. I like to add dynamic Text + dynamic Icon/Picture for each product using the "icon with text" feature in DAWN theme. however I am not able to find a suitable metafield that manages an icon and text at the same time.
just found this video https://www.youtube.com/watch?v=QodbszNa7cI
Hey I have the solution and you don't need a metafield for this. To implement an icon with text only to specific products go to:
Online Store>Customize
On the top in the middle you will see the two drop downs Default and Home page. Click on the Home page and select Products.
When selecting products you will see "Default products" and under that an option to create a new template. Create a new template and name it however you like.
After creating the new template go Products>select any of the products that you would like to put on the Icon with text and on the right in the option "Theme template" choose the new created template instead of Default. After putting your selected products into that template go back to Customize and open the new template and put the Icon with text on the selected products.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025