If you pass in the resource object into include, no resource solution is
done, though it changes the selectors.
Instead of adding another tag which makes it more unclear, whether to use
include, call, or partial - why not add an option to the include tag?
And if call has been invented to circumvent the above things, why not
deprecate it then?

Carsten


2014-08-22 12:30 GMT+02:00 Julian Sedding <[email protected]>:

> The approach mentioned by Carsten has two drawbacks:
> * it changes the selectors seen by any scripts included further down
> the include stack (IIRC this was the reason why <sling:call/> was
> introduced in the first place)
> * resourceResolution has to be done again, even though we know we want
> to render the same resource (maybe <sling:include
> resource="${resource}"/> also prevents this, I didn't check)
>
> I created SLING-3874[0] with a proof-of-concept implementation for a
> <sling:partial/> tag. This allows selecting another rendering script
> for the current resource with the specified selector. Downstream
> includes are not affected by this, however.
>
> Example page.jsp (see Gabriel's example above):
> <html>
>     <sling:partial selectors="head"/>
>     <sling:partial selectors="body"/>
> </html>
>
> Regards
> Julian
>
> [0] https://issues.apache.org/jira/browse/SLING-3874
>
> On Fri, Aug 22, 2014 at 12:11 PM, Gabriel Walt <[email protected]> wrote:
> >
> > Wow, couldn't believe this was working, very nice!! :)
> >
> > Thanks!
> >
> >
> > On 22/08/14 11:17, "Carsten Ziegeler" <[email protected]> wrote:
> >
> >>You can simply use sling:include instead, add a selector and your script
> >>act on that specific selector - that's language independent.
> >>
> >>Carsten
> >>
> >>
> >>2014-08-22 10:50 GMT+02:00 Gabriel Walt <[email protected]>:
> >>
> >>>
> >>> Thanks for your answers! Let me try to provide more context and be more
> >>> specific.
> >>>
> >>> With sling:resourceSuperType (or with /apps /libs overlaying), you can
> >>> customize any script of your component. A common practice is to split
> >>> large script templates into partials that can then each be
> independently
> >>> customized, to avoid full script duplication, and to adapt only parts
> >>> of it.
> >>>
> >>> The typical example is a page component that can for instance end up
> >>>with
> >>> a structure like:
> >>> - page.jsp
> >>>     - head.jsp
> >>>         - headlibs.jsp
> >>>    - body.jsp
> >>>         - top.jsp
> >>>         - content.jsp
> >>>         - bottom.jsp
> >>>         - bodylibs.jsp
> >>>
> >>> These scripts are usually all included with something like a
> sling:call,
> >>> but then this makes it impossible in an extending component to use a
> >>> different script language than the one used in the super-type (so in
> our
> >>> example we'd be forced to go with JSP, and couldn't use ESP, Sightly,
> >>>etc).
> >>>
> >>> Thus, it would be nice to be able to do an include of script partials
> >>>that
> >>> are not binding to a particular script language, like for instance:
> >>>     <sling:call script="myscript.*" />
> >>> instead of:
> >>>     <sling:call script="myscript.jsp" />
> >>>
> >>> Best,
> >>> Gabriel
> >>>
> >>>
> >>>
> >>
> >>
> >>--
> >>Carsten Ziegeler
> >>Adobe Research Switzerland
> >>[email protected]
> >
>



-- 
Carsten Ziegeler
Adobe Research Switzerland
[email protected]

Reply via email to