Bug Description
Variables set in a View Model are only injected into the template defined in the collection's yaml. They don't work in a collection loop. Is this right or a bug? I expect ViewModel variables to work from wherever I have access to collection data.
How to Reproduce
- Create a View Model and add it to a collection's yaml.
- Try to access the data returned in the View Model within a collection loop.
Environment
Statamic version: 3.0.0.-beta-43
PHP version: 7.4.6
Install method: Fresh install from statamic/statamic
Bug Description
Variables set in a View Model are only injected into the template defined in the collection's yaml. They don't work in a collection loop. Is this right or a bug? I expect ViewModel variables to work from wherever I have access to collection data.
How to Reproduce
Environment
Statamic version: 3.0.0.-beta-43
PHP version: 7.4.6
Install method: Fresh install from
statamic/statamic