Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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
Solved! Go to the solution
This is an accepted solution.
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' %}
<label for="message" class="form__label">Tell us what your secret message will be!
</label>
<div class="field">
<textarea id="message" class="text-area field__input" placeholder="Message" name="properties[Message]"form="product-form-{{ section.id }}"></textarea>
</div>
{% endif %}
{% endfor %}
Best regards,
GemPages Support Team
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
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' %}
{{<label for="message" class="form__label">Tell us what your secret message will be!
</label>
<div class="field">
<textarea id="message" class="text-area field__input" placeholder="Message" name="properties[Message]"form="product-form-{{ section.id }}"></textarea>
</div>}}
{% endif %}
{% endfor %}
This is an accepted solution.
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' %}
<label for="message" class="form__label">Tell us what your secret message will be!
</label>
<div class="field">
<textarea id="message" class="text-area field__input" placeholder="Message" name="properties[Message]"form="product-form-{{ section.id }}"></textarea>
</div>
{% endif %}
{% endfor %}
Best regards,
GemPages Support Team
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025