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

Add support for multiple active channels

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Neutral Neutral
    • None
    • 4.5.17
    • core, rendering
    • None
    • Yes
    • Yes

      The default implementation in Magnolia allows only one channel to be active during each request. We needed to have more than one active channel when rendering components or pages to show and hide elements based on the language AND the device at the same time. We came up with the attached solution. (source and some tests included, running in production with Magnolia 4.5.17)

      It consists of a custom MultiChannelFilter, which merges all currently active channels in one channel string and components, which extract the channels from this string when rendering nodes and determining variations.

      We had to extend and replace the following classes in the Magnolia configuration:

      • MultiChannelFilter -> merges all currently active channels in one channel string, separated by -
      • SiteMergeFilter -> determines a variation based on the available variations, the currently active channels and the extension (URL suffix)
      • RenderingFilter -> splits up the channel name before evaluating if complete pages should be shown or hidden
      • FreemarkerRenderer -> splits up the channel name before evaluating if content should be shown or hidden
      • StkRenderer -> splits up the channel name before evaluating if content should be shown or hidden

      It would be nice if a feature like this would be part of Magnolia. We think that displaying content based on multiple channels (language AND device) is a common use case.

        Acceptance criteria

              Unassigned Unassigned
              pdenzler Philipp Denzler
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD