Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi all. I'm a bit stuck on this one. I've done something before but cannot for the life of me remember how to do it. Any help is greatly apprecited.
I'm trying to show a Collection on a Blog Article Page. The Collection I need to show has the same handle as the blog article.
The Article handles will be along the lines of 'nigel-burke'. So the Collection I am trying to show on that Article page is called 'Nigel Burke' along with '-ambassador' at the end of the handle too. I'm then wanting to show the products in that particular collection on that particular article page.
This is the code I am trying to use...
{% capture my_variable %}{{ article.title | downcase | replace: ' ','-' | append: '-ambassador'}}{% endcapture %}
<div class='ambassador-collection'>
{% for product in collections.[my_variable].products %}
{{ product.title }}
{% endfor %}
</div>
But it's not working. Any help is greatly appreciated.
Nigel
Solved! Go to the solution
This is an accepted solution.
Hi @Nigel_Burke ,
This is Kate from PageFly - Landing page builder, I’d like to suggest this idea:
You can try below code:
{% capture my_variable %}{{ article.handle | append: '-ambassador'}}{% endcapture %}
<div class='ambassador-collection'>
{% for product in collections[my_variable].products %}
{{ product.title }}
{% endfor %}
</div>
I hope it would help you
Best regards,
Kate | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
➜ Unlock the secrets to a record-breaking BFCM with PageFly and Canva
➜ Optimize your Shopify store with PageFly Page Builder (Free plan available)
➜ Weekly updated Shopify tutorials on YouTube
All features are available from the Free plan. Live Chat Support is available 24/7.
This is an accepted solution.
Kate, thank you for taking the time to help me with this.
I managed to get it working with your help, thanks. There was a little change needed here and there as you weren't to know a few things it needed to do too.
You set me off in the right direction though, so thank you again!
This is how it ended up working for me...
{% capture my_variable %}{{ article.title | downcase | replace: ' ','-' | append: '-ambassador'}}{% endcapture %}
<div class='ambassador-collection'>
{% for product in collections[my_variable].products %}
{{ product.title }}
{% endfor %}
</div>
This is an accepted solution.
Hi @Nigel_Burke ,
This is Kate from PageFly - Landing page builder, I’d like to suggest this idea:
You can try below code:
{% capture my_variable %}{{ article.handle | append: '-ambassador'}}{% endcapture %}
<div class='ambassador-collection'>
{% for product in collections[my_variable].products %}
{{ product.title }}
{% endfor %}
</div>
I hope it would help you
Best regards,
Kate | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
➜ Unlock the secrets to a record-breaking BFCM with PageFly and Canva
➜ Optimize your Shopify store with PageFly Page Builder (Free plan available)
➜ Weekly updated Shopify tutorials on YouTube
All features are available from the Free plan. Live Chat Support is available 24/7.
This is an accepted solution.
Kate, thank you for taking the time to help me with this.
I managed to get it working with your help, thanks. There was a little change needed here and there as you weren't to know a few things it needed to do too.
You set me off in the right direction though, so thank you again!
This is how it ended up working for me...
{% capture my_variable %}{{ article.title | downcase | replace: ' ','-' | append: '-ambassador'}}{% endcapture %}
<div class='ambassador-collection'>
{% for product in collections[my_variable].products %}
{{ product.title }}
{% endfor %}
</div>
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn 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, 2025