- Merge request !26Issue #1195874: Need to figure out how to create nested tokens from the array token type β (Open) created by duaelfr
- π©πͺGermany Anybody Porta Westfalica
@Maintainers: Who can decide how to proceed here? And especially review the MR!26 from @DuaelFr so we can have a plan? :)
- π«π·France duaelfr Montpellier, France
I rerolled the MR on the latest dev version.
- π¨π¦Canada trevorkjorlien
@duaelfr, I have used your patch on the latest version of Token. But I'm not seeing the changes as expected.
I've tried multiple ways, trying to use a token as an argument for a View. Basically, showing a View and using a commerce order ID to get an order's details:
[views:embed:event_registration_order:[commerce_order:order_id]]
[views:embed:event_registration_order:commerce_order:order_id]
[views:embed:event_registration_order::[commerce_order:order_id]
[views:embed:event_registration_order::commerce_order:order_id]
I've had the View display before without an argument. But with this, it's not appearing, or it just shows the order ID. Am I using this incorrectly? Thanks!
- π«π·France duaelfr Montpellier, France
I'm not sure I understand your use case and I'm not sure this patch would allow you to achieve your goal.
My proposal is a very simple implementation of tokens for nested arrays (now I can see how it is confusing with the issue title and might be out of scope).
Before my PR, it was not possible to access deep values of a nested array with tokens because the last part of the token was considered as a simple key, even if it contained colons. Now, if there is no value with the key and if it contains colons, we explode the key and use it as a nested array selector to get the value.
I can't write examples because I'm on my phone but if it's still not understandable enough, tell me and I'll try again later.