Tag libraries related doubts | Community
Skip to main content
Level 9
October 16, 2015
Solved

Tag libraries related doubts

  • October 16, 2015
  • 3 replies
  • 986 views

Hi All,

In link https://docs.adobe.com/docs/en/cq/5-6/howto/taglib.html , there are couple of tag libraries which look similar

<CQ:INCLUDE>

<SLING:INCLUDE>

<SLING:DEFINEOBJECTS>

<CQ:DEFINEOBJECTS>

Is there any difference between these or they serve the same purpose. If there is any snippet of code that explains the difference, it would be helpful.

Can you please provide some inputs on this.

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

They can be used to achieve the same result, however it would really depend on what you are trying to do.  For example, the <sling:include> can do the same thing as the <cq:include>, but it has more parameters that you can use if you need them. You can read more about the attributes in the Sling documentation here: http://sling.apache.org/documentation/bundles/sling-scripting-jsp-taglib.html#include.

I would recommend reading these two articles if you would like more information on <sling:include> and <cq:include>:

http://dev.day.com/content/ddc/blog/2010/09/crx_gems_using_slin.html

https://helpx.adobe.com/experience-manager/kb/CQIncludes.html

3 replies

Accepted solution
October 16, 2015

They can be used to achieve the same result, however it would really depend on what you are trying to do.  For example, the <sling:include> can do the same thing as the <cq:include>, but it has more parameters that you can use if you need them. You can read more about the attributes in the Sling documentation here: http://sling.apache.org/documentation/bundles/sling-scripting-jsp-taglib.html#include.

I would recommend reading these two articles if you would like more information on <sling:include> and <cq:include>:

http://dev.day.com/content/ddc/blog/2010/09/crx_gems_using_slin.html

https://helpx.adobe.com/experience-manager/kb/CQIncludes.html

Feike_Visser1
Adobe Employee
Adobe Employee
October 16, 2015

The CQ-tags add more CQ/AEM specific functionalities on top of the Sling-tags.

I would always use the CQ-tags.

askdctmAuthor
Level 9
October 16, 2015

Hi Feike/swesto01,

Thanks a lot for providing inputs on this.