0
votes

I'm trying to create an adobe cq component and include a parsys element that users can drag other components into. However, when I drag items into my parsys component they always display outside of the html tags I wrapped around my include. What am I doing wrong?

html in my component jsp

<div class="div-one">
    div one
</div>
<div class="div-two">
     <cq:include path="par" resourceType="foundation/components/parsys" />
</div>

content.xml for my component

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:description=""
    jcr:primaryType="cq:Component"
    jcr:title="title"
    sling:resourceSuperType="foundation/components/parbase"
    allowedParents="[*/parsys]"
    componentGroup="My Group"
    cq:htmlTag=""/>

How the html is rendered in a browser after I think I dragged a component into div-two

<div class="div-one">
    div one
</div>
<div class="div-two">
     <cq:include path="par" resourcetype="foundation/components/parsys">
</cq:include></div>
<div id="myComponent" class="row">
</div>
1
If you have any component that have parsys inside it as you have in "div-two" and any component you drop inside that parsys also will be inside "div-two". If your component's divs are not under "div-two" then you are not adding the component to the parsys you added under "div-two".Vivek Dhiman
Can you post your CSS? The styles you use on the DIVs and other tags could explain this behavior.Shawn

1 Answers

0
votes

cq:include is a tag library element which should not appear in the rendered HTML.

Make sure to include global.jsp at the top of each JSP file when using the CQ taglib:

<%@ include file="/libs/foundation/global.jsp" %>

For more on the CQ taglib see this doc.