Reputation:
I added a single parsys component in my template using the code:
<div class = "BodyText" style="margin-top:75px;" >
<cq:include path="vff1" resourceType="foundation/components/parsys"/>
</div>
But when I create a page, and add some text to the parsys component, the component still stays on the page (below the text I added).
Is there a way to remove it after adding some asset (text or image etc.)in to the parsys ?
Upvotes: 2
Views: 5419
Reputation: 21
There is a way to remove the parsys, but I would advice to exercise this with caution. First in your include parsys you check if the component you want to add into this particular parsys exist or not. If it does than you just directly include in that component into your page, and if not then you include the parsys.
Sample code:
<c:choose>
<c:when test="<COMPONENT_EXIST>">
<cq:include path="<Path to component>" resourceType="<component resource>" />
</c:when>
<c:otherwise>
<cq:include path="<parsys_path>" resourceType="foundation/components/parsys" />
</c:otherwise>
</c:choose>
Upvotes: 0
Reputation: 6926
Agree with the answers given above. The correct answer will be just to summarize the above 2 answers.
Upvotes: 1
Reputation: 141
To add, the drop area appears only in author mode, if you want to check how it looks in publish mode you can select the preview mode in the sidekick. As such your publish site will be the live site in production
Upvotes: 2
Reputation: 1327
The parsys is a drop area for components. You cannot drop components into the parsys then remove the parsys without also removing the components contained inside as the components are sub-nodes of the parsys node in the jcr.
In your case it seems that you would prefer to embed the text component into the template instead of the parsys
<div class="BodyText" style="margin-top:75px;">
<cq:include path="text" resourceType="foundation/components/text"/>
</div>
Remember the path attribute needs to be unique.
Upvotes: 3