Closed AmbushXXVI closed 2 years ago
Inside the forEach block you should use the keyword 'this' to refer to the current item in the array. So replace the x.0.field with this.field
Note that in your handlebars you reference "entries" directly, but that is another array, so you will need another forEach block to read each individual entry in that array (even though there is only one, you still need to access it like an array of more than one). Something similar to:
{{#forEach entriesHigherLevel}}
## At Higher Levels
{{#forEach this.entries}}
this
{{/forEach}}
{{/forEach}}
Hrm. Thanks for pointing out that I'd missed that inner block. Unfortunately, I can't seem to get a forEach to work anywhere. I also tried with the fromClassListVariant, but I'm still getting the same createFrame error.
Class Variants (forEach): {{#forEach classes.fromClassListVariant}}{{this.name}} {{/forEach}}
So, not sure what's going on, but I tried using #each instead of the helper #forEach and it worked. Unfortunately, I don't really know if this will have any other effects down the line...
Update: Ahh. So other helper functions like isLast don't work with each.
Any chance you've had time and inclination to look at this? Still trying to figure out if it's my code, my source, or something in the import tool.
Thanks
I just had a look, and #forEach is broken in my distribution. I am trying to find how to include the required modules to get that working properly.
It looks like match from Handlebars-Helpers is also missing some modules, perhaps related.
I've changed the plugin to use a fork of handlebars-helpers (see https://github.com/Budibase/handlebars-helpers) which builds properly. This means that #forEach should now work properly in 0.12.0
thanks for taking the time to fix this :)
Thanks for the importer, I've finally got time to work through creating a template to import spells from 5etools. I'm attempting to use the forEach helper from handlebars-helpers library. During the import, I get the above error in the console. I've included the relevant block from my template below, as well as the json. Any ideas or suggestions as to what I'm doing wrong?