I have an urgent demo showcase for Ghost and I have the following context. Though not specific to Ghost, its a general problem
{
posts: [{
name: 'post1',
id: 1,
tags: [{
id: 1,
name: 'tag1'
},{
id: 5,
name: 'tag5'
}]
},
{
name: 'post2',
id: 2,
tags: [{
id: 1,
name: 'tag1'
},{
id: 3,
name: 'tag3'
}]
}]
}
I want to create a filter
helper in HandleBars.js which will display all posts whose tag name is 'tag1'
Something like
{{#filter posts tags[].name="tag5"}}
<h1> {{name}} </h1>
{{/filter}}
Outputs
<h1> post1 </h1>
EDIT
I have seen filter
helpers, I think what I need is deepfilter
helper.