How to customize a textbox for a specific product in Dawn theme?

I have some dev experience and I’m playing around customizing my own site from the Dawn theme. I had an issue where I needed a textbox for a specific product so I made a textfield input for it, but I realized it shows up to all of my products. How can I make it only for a specific product?

Right now I have a custom Liquid for the textbox

Hello @KevP ,

It’s GemPages support team and glad to support you today.

In this case, you can add a tag (eg: show-textbox) for the products that you want to show the textbox.

After that, you could please try using format code:

{% for tag in product.tags %}
{% if tag contains 'show-textbox' %}
{{YOUR_TEXTBOX_CODE}}
{% endif %}
{% endfor %}

Best regards,
GemPages Support Team

1 Like

Hi thank you for the reply, I just added the tags and formatted the code using the for loop logic you provided and I am getting syntax errors. Today is my first day seeing Liquid language/syntax, sorry. Should I assume this goes to a .liquid file when I “edit code”?

{% for tag in product.tags %}
{% if tag contains 'show-textbox' %}
{{

  

}}
{% endif %}
{% endfor %}

Hi @KevP ,

There is a misunderstanding here. You should replace {{YOUR_TEXTBOX_CODE}} with your code.

It should look like that

{% for tag in product.tags %}
{% if tag contains 'show-textbox' %}

  

{% endif %}
{% endfor %}

Best regards,
GemPages Support Team

1 Like