Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-5812

Add option to include attributes in request scope for Sightly data-sly-resource and data-sly-include

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Scripting Sightly Engine 1.0.18
    • Component/s: Scripting
    • Labels:
      None

      Description

      A common pattern for sending information between scripts/components is setting specific attributes in request scope before including another resource or script. At the moment this cannot be done nicely in Sightly.

      It would be very helpful to set request attributes as in following examples:

      <sly data-sly-include="${'script.html' @ requestAttributes=helper.attributesMap}"/>

      or:

      <sly data-sly-resource="${'some/path' @ resourceType='some/type', requestAttributes=helper.attributesMap}"/>

      where attributesMap is a Map<String, Object>

      The attributes would be set before the actual script/resource inclusion and reset/unset back afterwards.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                radu.cotescu Radu Cotescu
                Reporter:
                vladb Vlad Bailescu
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: