Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
Not even sure how to describe my issue but I have run in to it before and couldn't resolve it so I have avoided it since. Hoping to get the solution here in writing.
I have a split description. {{ product_description[2] }} is the articles url. It shows what it needs to elsewhere, but once it goes inside article object it all falls apart.
{% assign article = articles['{{ product_description[2] }}'] %}
Also if I replace the {{ product_description[2] }} inside the article object with the article url handle everything works nicely.
Sure it is a simple syntax issue but would love to know the answer once and for all.
Any help is greatly appreciated.
You can't nest fiters like that. Not sure of the complete usage but looking at your code above I'd expect this approach:
{% assign articleHandle = product_description[2] | strip %}
{% assign article = articles[articleHandle] %}
Added the strip in as well to help catch any whitespace that might be in your string.
Jason,
Worked like a charm.
You're always coming through with the simple answers. Thank you for this response and all the others you've made out there that have helped me in the past.
User | RANK |
---|---|
211 | |
111 | |
87 | |
59 | |
48 |