Re: Sightly :: JavaScript Use-API :: what property to use instead of "granite.resource" to access the current resource in JS?
Hi Sandro, I started putting together some documentation at [2] but it's stil WIP. Vlad [2] - https://github.com/vladbailescu/sling-sightly-docs/blob/master/use-api.md On Sunday, October 18, 2015, Sandro Boehme wrote: > Hello, > > I would like to access the current resource in the Sightly JavaScript > Use-API. The docu [1] says I should for example use > "granite.resource.properties["title"];" to access the "title" property of > the current resource. But of course "granite" is not available in Sling. > This is why I'm wondering what variable is available in Sling instead. > > Thanks in advance for any hints, > > Sandro > > [1] - > http://docs.adobe.com/docs/en/aem/6-0/develop/sightly/use-api-in-javascript.html > > PS: There is no Sling docu for Sightly yet, right? > -- Sent from mobile
Sightly :: JavaScript Use-API :: what property to use instead of "granite.resource" to access the current resource in JS?
Hello, I would like to access the current resource in the Sightly JavaScript Use-API. The docu [1] says I should for example use "granite.resource.properties["title"];" to access the "title" property of the current resource. But of course "granite" is not available in Sling. This is why I'm wondering what variable is available in Sling instead. Thanks in advance for any hints, Sandro [1] - http://docs.adobe.com/docs/en/aem/6-0/develop/sightly/use-api-in-javascript.html PS: There is no Sling docu for Sightly yet, right?
Re: JavaScript in Sling
Hi Justin, thanks for your quick feedback! It's good to know that I can use the JSR-233 API. I was wondering if JavaScript is available out of the box in other areas. But I guess it's mainly ESP's and the JavaScript Use-API of Sightly. Thanks, Sandro Am 13.10.15 um 22:50 schrieb Justin Edelson: Hi Sandro, JavaScript support is available to any application in Sling using the JSR-233 API. Regards, Justin On Tue, Oct 13, 2015 at 4:28 PM Sandro Boehme wrote: Hello, I found out, that JavaScript support is not only available in ESP files but also in Sightly [1]. Is JavaScript supported in other areas of Sling as well? Best, Sandro [1] - http://docs.adobe.com/docs/en/aem/6-0/develop/sightly/use-api-in-javascript.html