Changing the extension with sling:include

2011-07-17 Thread Phil Rice
I would like to be able to make it so that when I use a sling:include I can request the included resource to have a different extension. In the following experiment I am trying to get the .json representation of the children to be included. I tried the following in sling/servlet/default/hello.jsp

Re: Changing the extension with sling:include

2011-07-17 Thread Julian Sedding
Hi Phil You can simply do sling:include path=.json/ if you want the current resource rendered as json or in your case sling:include path=%=child.getPath()%.json/ (optionally with resourceType attribute). Note: the default json rendering servlet sets the Content-Type header to application/json.

Re: Changing the extension with sling:include

2011-07-17 Thread Phil Rice
Thank you that worked perfectly On Sun, Jul 17, 2011 at 12:15 PM, Julian Sedding jsedd...@gmail.com wrote: Hi Phil You can simply do sling:include path=.json/ if you want the current resource rendered as json or in your case sling:include path=%=child.getPath()%.json/ (optionally with