This is really killing me, but I can’t figure out what’s going on and any insight would be enormously appreciated. I’m trying to return a list of all posts in a category using:
{% for post in taxonomy.findTaxonomy({'category': ['patterns']}) %}
<tr>
<td class="title">{{ post.title }}</td>
<td class="summary">{{ post.summary }}</td>
<td class="link"><i class="fa fa-rocket"></i> <a href="{{ post.url }}" title="view the {{ post.title }} micro-pattern">view it!</a></td>
</tr>
{% endfor %}
There are at minimum 30 posts under that category, but this loop returns nothing. I tried:
{% for post in taxonomy.findTaxonomy({'category': 'patterns'}) %}
{% for post in taxonomy.findTaxonomy({'category': [patterns]}) %}
To no avail. I’d even be happy with a list of all posts right now, so I can dwindle it down by specific titles.
As far as I can tell, there’s something odd happening when I call the macro. So I just put the following in the code for the template and it runs fine.
{% if header.micro_patterns.enabled %}
<section class="micro-patterns">
<header>
<h3><i class="fa fa-cubes"></i> Micro-patterns</h3>
<hr>
</header>
<article>
<table class="definition-table">
<thead>
<tr>
<th class="title">Title</th>
<th class="link">Link</th>
</tr>
</thead>
<tbody>
{% for i, mpost in taxonomy.findTaxonomy({'category': ['patterns']}) %}
{% for j, name in header.micro_patterns.mpNames %}
{% if (name == mpost.title) %}
<tr>
<td class="title">{{ name }}</td>
<td class="link"><i class="fa fa-rocket"></i> <a href="{{ mpost.url }}" title="view the {{ mpost.title }} micro-pattern">view it!</a></td>
</tr>
{% endif %}
{% endfor %}
{% endfor %}
</tbody>
</table>
</article>
</section>
{% endif %}
There might have been some goofiness going on with having nested for loops as well, but the above code works like I need it to - just not from a macro.