Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

sling include

Avatar

Level 5

I have used <sling include path="" /> but what is <sling:include resource="" />?

Can someone help me know the diffrence between them?

1 Accepted Solution

Avatar

Correct answer by
Employee

path comes handy when you want to render resources with selectors path="${somepath}.withselector.html"

View solution in original post

2 Replies

Avatar

Level 2

I believe you can use resource= instead of path= if you've already got a reference to a resource using getResource, e.g. 

sling:getResource(resourceResolver,'/content/page')

See http://sling.apache.org/documentation/bundles/sling-scripting-jsp-taglib.html#include

Avatar

Correct answer by
Employee

path comes handy when you want to render resources with selectors path="${somepath}.withselector.html"