I have a handelbars page where depending on the title item in json it'll show different content.
so far this is built using helper if_wq
for example if title = test this works
I would like a way to extend this functionality to show if title = test and colors.href = /test
so the condition is only valid if both conditions are true.
example of my code
{{#if_eq title 'test'}}
True
{{/if_eq}}
Example of my helper task
handlebars.Handlebars.registerHelper('if_eq', function(a, b, opts) {
if (a === b) {
return opts.fn(this);
} else {
return opts.inverse(this);
}
});
example of my json
"range-list-page": {
"ranges": [
{
"title": "test",
"colors": [
{
"color": "#fff",
"label": "White",
"bordered": true,
"href" : "/test"
},
{
"color": "#F3DCAE",
"label": "Cream",
"href" : "http://google.com"
},
{
"color": "#C5B7B0",
"label": "Cashmere",
"href" : "http://google.com"
},
{
"color": "#D0B193",
"label": "Larch",
"href" : "http://google.com"
}
]