Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I'm using this music widget on my shopify and received a code to edit the theme liquid. I only want the widget to appear on one specific page. I used {% if template.name == 'page'%} "insert widget code here" {% endif %} but the widget shows up on all pages and interferes with the experience. Am I able to specify which page name it shows up on. Please let me know. Thank you!
Hi @yayamusic2270 , you can use below code
{% if page.handle contains "music-page-url" %}
"insert widget code"
{% endif %}
if above code is not work then you can use this -
{% if page.handle == "music-page-url" %}
"insert widget code"
{% endif %}
Thanks
That’s a great idea; allow us to help you achieve this. Here is the solution you are looking for.
We are providing the correct code for your help. Please use this and see if it works.
{% if page.title=="music-page-title" %}
add Code here (widget)
{%endif%}
{% if page.handle contains "music-page-url" %}
add code here (widget)
{% endif %}
{% if page.handle == "music-page-url" %}
Add code here (widget)
{% endif %}
Let us know if you need more help with this.
Regards,
CedCommerce
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