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

Provide templating function to get first occurrence of a node property

    XMLWordPrintable

Details

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

    Description

      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.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:

                  Checklists

                    Task DoD