Class FragmentExtensions


  • public class FragmentExtensions
    extends Object
    Holds the layout fragments encountered across layout/decorator and content templates for use later.
    Author:
    zhanhb, Emanuel Rabina
    • Constructor Detail

      • FragmentExtensions

        public FragmentExtensions()
    • Method Detail

      • getFragmentCollection

        public static Map<String,​List<IModel>> getFragmentCollection​(ITemplateContext self,
                                                                           boolean fromDecorator)
        Retrieves the fragment collection for the current context.
        Parameters:
        self -
        fromDecorator -
        Returns:
        A new or existing fragment collection.
      • setLocalFragmentCollection

        public static void setLocalFragmentCollection​(IElementModelStructureHandler self,
                                                      ITemplateContext context,
                                                      Map<String,​List<IModel>> fragments,
                                                      boolean fromDecorator)
        Set a fragment cache to contain any existing fragments, plus the given new fragments, with the same scope as setting a local variable.
        Parameters:
        self -
        context -
        fragments - The new fragments to add to the cache.
        fromDecorator - Whether the call was from DecorateProcessor, used for determining if a new fragment collection should be used and the order of collected fragments.