[MAGNOLIA-8849] Area context attributes not passed to component variants Created: 23/Mar/23 Updated: 06/Jun/23 |
|
| Status: | Open |
| Project: | Magnolia |
| Component/s: | freemarker, templating |
| Affects Version/s: | 6.2.30 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Richard Gange | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Template: | |||||
| Acceptance criteria: |
Empty
|
||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||
| Epic Link: | AuthorX Support | ||||
| Team: | |||||
| Description |
|
Context attributes are not passed to component variants. Consider an area which uses a custom template script:
areas:
main:
templateScript: /travel-demo/templates/pages/mainArea.ftl
In the script we pass contextAttributes to the component:
[#list components as component ]
[@cms.component contextAttributes={"indexString":indexString, "useIndex":useIndex}/]
[/#list]
When trying to access the context attributes in the component script they are lost when component variants are in place.
${ctx.indexString}
${ctx.useIndex}
Reproduce
Actual Expected |