Log in Sign up

Recent entries filtered by tag?

I seems odd to me that I can easily filter "all_entries" array with "tagged.TagName" but I can not do the same with "recent_entries." If I use the combination inside a template it will output all "TagName" tagged entries within the last 30 entries.

I guess the other option is "truncate" the output, but I couldn't find how to do that in the template language reference. I understand that there is a script option, but I'm already hacking too many things on blot with scripts and it's getting dangerous ((

{{#all_entries}}{{#tagged.TagName}} <<-- how to limit output ? to X entries --|
<a href="{{url}}">{{title}}</a>
{{#tagged.TagName}}{{/all_entries}} 

a year ago, 1 replies   developers   Edit question

It's not possible to do what you want using the template tags alone right now – I'd suggest using CSS to truncate the list after generating it using {{#all_entries}} – something like this:


<div id="first-five-tagged-apple">
{{#all_entries}}
{{#tagged.apple}}
<a href="{{{url}}}">{{title}}</a><br>
{{/tagged.apple}}
{{/all_entries}}
</div>

<style>
#first-five-tagged-apple a:nth-child(n+6) {
display:none
}
</style>
Answered a year ago · Edit answer