Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

Tag libraries related doubts

Avatar

Level 9

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.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

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

View solution in original post

3 Replies

Avatar

Correct answer by
Former Community Member

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

Avatar

Employee

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

I would always use the CQ-tags.

Avatar

Level 9

Hi Feike/swesto01,

Thanks a lot for providing inputs on this.