Hey Dirk, The way to go about doing this at the moment is to provide your own RuntimeExtension (with a higher service ranking).
Best, Vlad On Tue, Apr 7, 2015 at 12:46 PM, Dirk Rudolph <[email protected]> wrote: > Hi @devs, > > while working on a project with a default Apache Sling based > AEM6+Dispatcher infrastructure, we mentioned, that there is no way to > provide a different include behaviour for resource includes - for example > include using SSI instead of directly calling the RequestDispatcher. > > In times of JSPs it was easy to implement a custom include tag the > delegates to the <sling:include/> when the include should be done directly. > Unfortunately this isn’t possible with Sightly so far (and as I understood > this is also intended to be not possible). > > Nevertheless it would be nice to have the possibility to use different > behaviours for resource includes also in sightly. I had a look at the > implementation and in general it would mean to expose the includeResource > method in [1] in a SPI that will be implemented per behaviour identified by > an option in the sightly template: > > <section data-sly-resource="${ 'path/to/resource' @ mode=‘<behaviour>' > }"></section> > > The default behaviour of directly including the resource would stay the > same (when mode isn’t specified) and would also be the fallback when the > specified behaviour isn’t available. So the suggestion is fully compatible > with previous versions of sightly. > > What do you thing?/comments appreciated. > > Cheers, > > --- > Dirk Rudolph | Senior Software Engineer > > Netcentric AG > > M: +41 79 642 37 11 > D: +49 174 966 84 34 > > [email protected] <mailto:[email protected]> | > www.netcentric.biz <http://www.netcentric.biz/>[1] > http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/ResourceRuntimeExtension.java?view=markup#l247 > < > http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/ResourceRuntimeExtension.java?view=markup#l247 > >
