Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
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"