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

TemplatingFunctions: collectAllChildren is needed -> add getNodeUtil() & getPropertyUtil()

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 6.2.2
    • templating
    • None

      In templating its pretty cumbersome to collect all nodes from a certain type within a workspace, no matter how deep they are located in the workspace (folders etc).

      In Java simply achieved:

      Iterable<Node> childrenIterable = NodeUtil.collectAllChildren(jcrSession.getRootNode(),new NodeTypePredicate("mgnl:contact", true));
      

      In Freemarker it would be nice to have something alike this (workspace, nodeType):

      [#assign allContacts = cmsfn.collectAllChildren("contacts", "mgnl:contact")]
      

      In a template one needs to code a recursion/macro for it.

       

      Also it would be nice do be able to directly access the NodeUtil and the PropertUtil directly:
      Something alike

      [#assign nodeUtil = cmsfn.nodeUtil]
      [#assign propertyUtil = cmsfn.propertyUtil]
      

        Acceptance criteria

              Unassigned Unassigned
              cringele Christian Ringele
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:

                  Task DoD