924 votes
0 answers
Shopify List Blog Tags
Solution:
You are just missing quotes aroundrecipes
. Currently, Liquid is treatingrecipes
as a variable and since it is undefined, it silently fails. All you needs is'recipes'
or"recipes"
to specify that you want to access blogs property namedrecipes
. So the code would become
<div id=”blog-tags”>
<!– Loops over all the tags used in Recipes blog –>
{% for tag in blogs['recipes'].tags %}
<h2>{{ tag }}</h2>
{% endfor %}
</div>
Alternatively, you can also doblogs.recipes.tags
<div id=”blog-tags”>
<!– Loops over all the tags used in Recipes blog –>
{% for tag in blogs.recipes.tags %}
<h2>{{ tag }}</h2>
{% endfor %}
</div>
Undefined asked
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.