sling include | Community
Skip to main content
Jai1122
Level 4
October 16, 2015
Solved

sling include

  • October 16, 2015
  • 2 replies
  • 1275 views

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

Can someone help me know the diffrence between them?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Feike_Visser1

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

2 replies

Tim_Donovanuk
Level 2
October 16, 2015

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

Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

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