Replies: 1 comment
-
@kluma thank you for the information. I think it's ok to use helper for this although in handlebars we use directive for partial/include, but directive has been deprecated in upstream javascript version. So for the first question, yes. And do you know in handlebars, we can provide additional context to partial, or use partial parameters: https://handlebarsjs.com/guide/partials.html#partial-contexts This is very similar to the attribute approach. Correct me if I was wrong. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there!
First greetings for version 6, I'm actually using handlebars along with axum and https://stimulus.hotwired.dev/ for js.
Content is provided by strapi CMS and result is pretty good. (https://red.software.systems is the final result).
Thank you for you library!
I've created (for previous HB version) an helper extension that allows me to pass attributes along with context:
{{include components/picture class="logo" data.logo.data}}
This is like an import but with
__attributes
context that can be used like in the following snippet:<img class="{{__attributes.class}}" src="{{attributes.url}}" alt="{{attributes.alternative_text}}" height="{{attributes.height}}" width="{{attributes.width}}" loading="lazy" />
Implementation is made implementing HelperDef trait, I've now to questions:
Is it still to implement HelperDef for this task ?
Does it make sense to create a crate for this extension and make it public ?
Regards,
Andrea
Beta Was this translation helpful? Give feedback.
All reactions