SubSul
SubSul

Reputation: 2563

Difference between cq:include and sling:include

What is the difference between sling and cq includes and when should each one be used? I kinda find both solving the same purpose. There is this link which recommends use of sling include and then there is cq doc which recommend use of cq include. As a programmer, under which situation will each of these includes be apt?

Upvotes: 0

Views: 5210

Answers (2)

Shishir
Shishir

Reputation: 11

If you have a component that has more than one jsp,to invoke the other jsp which doesnt match up with component name , sling include is helpful having replaceselector attribute having other jsp as a value

Upvotes: 1

Thomas
Thomas

Reputation: 7118

Usually if you are developing a CQ component, I'd follow the suggestion to use the cq:include. The sling:include has some additional parameter which can come handy if you need them, but I think in my 5 years as a CQ dev, I only had to use the sling:include once. See sling documentation for the parameter: http://sling.apache.org/documentation/bundles/sling-scripting-jsp-taglib.html#include

Upvotes: 1

Related Questions