Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-8849

Area context attributes not passed to component variants

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Neutral Neutral
    • None
    • 6.2.30
    • freemarker, templating
    • None

      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

      1. Create an area script which passes attributes.
      2. Configure the templateScript in the page template definition.
      3. Create a page with two components.
      4. Add a component variant to one of the components.

      Actual
      The component with variants cannot access the passed contextAttributes. The regular (non-variant) component can.

      Expected
      The contextAttributes should be accessible in the component variant.

        Acceptance criteria

              Unassigned Unassigned
              rgange Richard Gange
              AuthorX
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:

                  Bug DoR
                  Task DoD