dawn theme - metafields - icon with text section on product page

Solved

dawn theme - metafields - icon with text section on product page

xnyjyh
Trailblazer
390 0 45

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

Accepted Solution (1)

wo
Shopify Partner
205 43 43

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

wo_0-1712023619649.png

 

View solution in original post

Replies 11 (11)

AnneLuo
Shopify Partner
1299 228 266

Hello, @xnyjyh 

Your requirements should require custom code.

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to Email Me   

Buy Me A Coffee

xnyjyh
Trailblazer
390 0 45

You're kidding me, right?! that's your answer?... maybe you need to read my question, again...

AnneLuo
Shopify Partner
1299 228 266

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.

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to Email Me   

Buy Me A Coffee

xnyjyh
Trailblazer
390 0 45

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. 

wo
Shopify Partner
205 43 43

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

wo_0-1712023619649.png

 

xnyjyh
Trailblazer
390 0 45

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

wo
Shopify Partner
205 43 43

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

wo_4-1712026329268.png

This product displays icons and text.

 

wo_5-1712026442075.png

 

Product pages without added text do not display icons and text

wo_6-1712026511123.png

 

 

 

 

 

xnyjyh
Trailblazer
390 0 45

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

xnyjyh
Trailblazer
390 0 45

Figured it out. Ive done few metafields, but never this way before, thanks! 🙂

JoelSteinmann
Shopify Partner
4 0 1

Screenshot 2024-04-25 at 18.23.45.png

 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

ecomnom
Tourist
4 0 1

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.