Hi,
Still relatively new to ghost and have been learning about themes. As an exercise, I am trying to produce a page that lists posts grouped by tags:
tag1
- post
- post
- post
tag2
- post
- post
- post
Here’s the code I’ve been trying to make work:
```
{{#get "tags" limit="all" include="count.posts" order="count.posts desc"}}
{{#foreach tags as |alltags|}}
<a href="{{ url }}">
<h2>{{ name }} <small>({{ count.posts }})</small> {{alltags.slug}}</h2>
</a>
{{#get "posts" limit="3" filter="tag:{{alltags.slug}}" include="tags,authors"}}
<ul>
{{#foreach posts}}
<li>{{ title }}</li>
{{/foreach}}
</ul>
{{/get}}
{{/foreach}}
{{/get}}
```
This is the bit that doesn’t seem to be working, inside the second nested #get call
filter=“tag:{{alltags.slug}}”
If I leave that in the nested #get posts call, nothing is returned.
If I take the filter out of that #get posts call, it does print out the first 3 posts but its obviously not filtered. Additionally, the {{ alltags.slug }} does populate inside of the nested foreach, so I’m wondering why it does not seem to be populated inside the #get posts call
Should I expect this to work? Getting all tags, looping through the tags and then getting all posts with the current tag in that first loop?
Hope this is clear and thanks in advance for any guidance