Currently I can get custom fields all or none. Like this
{{#each product.custom_fields}}
{{ id }} : {{ name }} : {{ value }}
{{/each}}
but what if i want to call just one of them by id or name like the below. Is there a way to do that with stencil or otherwise?
{{product.custom_fields.id:4.name}}
2
Answers
You can use the existing {{if}} helper to accomplish this
You can select a list item by id.
{{product.custom_fields.id.4.name}}
, however, if you want to select by name you’ll need to implement a conditional as @alyss suggested.See: How do I access an access array item by index in handlebars?