- Issue created by @sea2709
- πΊπΈUnited States sea2709 Texas
I also noticed that in the action Render: Add Class, the machine name field is a token support field as well. I would like to set the machine name as "wrapper][form][submit", and the name ends up with wrapper][submit. I'm not sure if it makes sense that machine name doesn't support token, or there should be an option to enable token support or not!
- πΊπΈUnited States sea2709 Texas
When I dug into the code, I noticed in the Actions.php (service class for Drupal core actions in ECA), it adds to the action plugin configuration an option "replace_tokens". I'm curious, how this setting is being used and can we expand this option to other plugin actions?
- π©πͺGermany jurgenhaas Gottmadingen
I remember a recent discussion on Slack with the same topic. As changing the token replacement behaviour at this point because that would break a lot of existing ECA models, it is better to define 2 tokens named
[bracket:open]
and[bracket:close]
with the values[
and]
. Then use those tokens instead of the brackets at all places where you want to avoid replacements. Those tokens will then be replaced with the brackets, and as token replacement is not recursive by default, you should end up with the required result.Extra tip: with the ECA token generate event event, you can define those tokens globally so that you don't have to do that everywhere across all your models.
- Status changed to Closed: works as designed
10 months ago 6:16pm 20 August 2024 - πΊπΈUnited States sea2709 Texas
Thanks @jurgenhaas for your tip. Yeah, I didn't think about a token with bracket as value.
- Status changed to Fixed
10 months ago 6:40am 21 August 2024 - π©πͺGermany jurgenhaas Gottmadingen
I'm adding a sample for that in the ECA Guide, I think. Added an issue at https://gitlab.lakedrops.com/drupal/documentation/eca/-/issues/69
Automatically closed - issue fixed for 2 weeks with no activity.