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

Provide templating function to get first occurrence of a node property

XMLWordPrintable

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

      Something like

          / * @return a String representation of the first property occurrence, else null. Will search recursively all <code>mgnl:</code> nodes types under the passed root node.
           */
      public String findFirstProperty(Node root, String propertyName) throws RepositoryException
      

      This will come in handy in situations like the one we have in demo-travel where the teaser component searches for a teaser image id. Currently this is done within the Freeemarker template with a recursive function but that has some limitations besides introducing perhaps too much complexity in an ftl.

        Acceptance criteria

              Unassigned Unassigned
              fgrilli Federico Grilli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:

                  Task DoD