Using dynamic partial elements in hand panels

I am trying to use dynamic partial elements in Handlebars using Gulp and gulp -compile-handlebars.

I saw this roll-up solution , but I believe that Handlebars now supports dynamic partial files out of the box, however I don't understand what the documentation expects from me.

In my hbs template, I want to specify a partial value-based name in my data, e.g.

"things": [ { "partial_template": "thing1", "title": "Thing 1" }, { "partial_template": "thing2", "title": "Thing 2" } ] 

With particles named as:

thing1.hbs, thing2.hbs, etc.

I donโ€™t think my requirements should use subexpressions, so it was expected to use a search helper according to Handlebars docs:

 {{> (lookup . 'partial_template') }} 

But these are errors when starting Gulp.

Any suggestions as to where I am going, right?

+5
source share

All Articles