Closed maiertech closed 9 years ago
Just read in Liquid docs that filters can be applied only to output tags {{ }}
. Is there any way to select a subset from a collection other than iterating through the collection with a for loop?
Try the where
filter.
This repository is no longer maintained. Please search for your issue on Jekyll Talk, our new community forum. If it isn't there, feel free to post to the Help category and someone will assist you. Thanks!
I have a collection classification. In a template I want to read one item from the collection based on a front matter
id
value.I thought this is straightforward. But then I noticed (using the Octopress debugger) that after executing
item contains a flattened String representation of the collection item and not the collection item itself (as I would have expected). I noticed the same for the group_by filter. It seems that the assign tag in conjunction with these filter flattens the result to a String. It does not seem to be the filter itself. Jekyll's where filter seems fine when I look at the source code.
When I do
without filter, the debugger shows me that item contains the actual collection as it should.
What is the expected behavior when applying the filters mentioned here: http://jekyllrb.com/docs/templates/?