How to include an existing component multiple times

sandeep_bhandar

15-10-2015

I am going to create a component which needs to reuse the existing component 3 times. In my component's JSP file I added following but getting blank page when creating a template for my component and then creating a page for that template.

<code><%@taglib prefix="cq" uri="http://www.day.com/taglibs/cq/1.0" %><% %> haha <cq:include path="test" resourceType="/apps/help/components/relatedlinks" /> <cq:include path="test1" resourceType="/apps/help/components/relatedlinks" /> <cq:include path="test2" resourceType="/apps/help/components/relatedlinks" /> </code>

Accepted Solutions (1)

Accepted Solutions (1)

Opkar_Gill

Employee

15-10-2015

Hi,

Are you getting any errors in the error.log file? Does it work when you replace your custom components with OOTB components? 

I just tried the code below and it works as expected:

<%@taglib prefix="cq" uri="http://www.day.com/taglibs/cq/1.0" %><%
%><div class="center">
    <cq:include path="title1" resourceType="foundation/components/title" />
    <cq:include path="title2" resourceType="foundation/components/title" />
    <cq:include path="title3" resourceType="foundation/components/title" />
</div>