liquid icon indicating copy to clipboard operation
liquid copied to clipboard

[Proposal] Passing other variable values to a snippet

Open mnj-novicell opened this issue 9 months ago • 0 comments

Hi I was wondering if it´s possible to add other variable values to snippet renders? I find it cumbersome to have to capture a value only to send that value to the snippet. It would be a lot nice if we could be able to add variables into strings, like this example with the button_id.

It would also be great to be able to add translations directly or other filters like capitalize instead of having to capture it.

{% render 'base-button',
  button_id: '{{ id }}-trigger',
  button_aria_label: 'general.my_translation' | t
%}

If it´s already possible and I´m just using the wrong syntax, that would be great to know, otherwise it would be a nice upgrade for the developer experience.

mnj-novicell avatar Mar 25 '25 21:03 mnj-novicell