Reputation: 744
I have the following block of code in my index.liquid
<div class="news-notable">
<h2>New & Notable</h2>
<ul>
{% for article in blogs[blog.news].articles limit: 4 %}
<li><a href="{{ article.url }}">{{ article.title }}</a><br />
<span class="date">{{ article.published_at | date: '%b %d, %Y' }}</span></li>
{% endfor %}
</ul>
</div>
Nothing is being outputted after the h2. I've also tried just using
{% for article in blogs.articles %}
And that didn't work either. Thanks in advance for the help!
Upvotes: 2
Views: 3447
Reputation: 4897
You need to include the blog handle inside the square brackets.
For instance, if your blog handle is news
, your for loop would be:
{% for article in blogs[news].articles limit: 4 %}
...
{% endfor %}
or:
{% for article in blogs.news.articles limit: 4 %}
...
{% endfor %}
Upvotes: 5