-
-
Notifications
You must be signed in to change notification settings - Fork 600
Closed
Labels
Description
Bug Description
When creating an array variable into a given view, trying to access the keys with a dynamic value doesn't seem to work. (Antlers)
How to Reproduce
- Create a collection in the CP. E.g.
menu_items:
item_1:
icon_id: locate
item_2:
icon_id: phone
item_3:
icon_id: basket
item_4:
icon_id: profile
- Create an Antlers view with a template variable at the top. E.g.
---
viewbox:
locate: some_data
phone: some_data
basket: some_data
profile: some_data
---
- Loop over the collection (e.g.
menu_items) and try to get template's variable keys dynamically
{{ menu_items }}
{{ icon_id }} // --> locate, phone, basket, profile
{{ view:viewbox[icon_id] }} // no output
{{ /menu_items }}
Environment
Statamic version: 3.1.18
PHP version: 8.0.2
Laravel version: 8.43.0
Install method (choose one):
- Starter kit (
statamic/statamic)