Hi,
I am including a component like this:
<c:forEach begin="0" end="${selectList-1}" varStatus="loopSubmenu"> <sling:include path="submenu_${loopSubmenu.index}" resourceType="aemdevcenter/components/content/global-header/submenu" /> </c:forEach>
and to get rid of the auto generated divs I have included the below code in my global.jsp
<% if (WCMMode.fromRequest(request) != WCMMode.EDIT && WCMMode.fromRequest(request) != WCMMode.DESIGN && WCMMode.fromRequest(request) != WCMMode.DISABLED && WCMMode.fromRequest(request) != WCMMode.PREVIEW) { IncludeOptions.getOptions(request, true).forceSameContext(Boolean.TRUE); } %>
But I am still not able to get rid of the auto generated divs and this is messing with the styles. Any ideas ?
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
You probably just have it wrong.
<% if (WCMMode.fromRequest(request) == WCMMode.EDIT || WCMMode.fromRequest(request) == WCMMode.DESIGN) { %> <c:forEach begin="0" end="${selectList-1}" varStatus="loopSubmenu"> <sling:include path="submenu_${loopSubmenu.index}" resourceType="aemdevcenter/components/content/global-header/submenu" /> </c:forEach> <% } else { %> <c:forEach begin="0" end="${selectList-1}" varStatus="loopSubmenu"> <sling:include cq:noDecoration="true" path="submenu_${loopSubmenu.index}" resourceType="aemdevcenter/components/content/global-header/submenu" /> </c:forEach> <% } %>
Views
Replies
Total Likes
Views
Replies
Total Likes
When I try to use either cq:noDecoration or cq:cellName(empty) I lose the ability to author the component.
Views
Replies
Total Likes
Wrap the include in an if statement. If you're in edit or design mode, do not include the "cq:noDecoration" or "cq:cellName(empty)" tags, otherwise do.
Views
Replies
Total Likes
So do you want me to include
<sling:include path="submenu_${loopSubmenu.index}" resourceType="aemdevcenter/components/content/global-header/submenu" />
Inside the if statement
if (WCMMode.fromRequest(request) != WCMMode.EDIT && WCMMode.fromRequest(request) != WCMMode.DESIGN && WCMMode.fromRequest(request) != WCMMode.DISABLED && WCMMode.fromRequest(request) != WCMMode.PREVIEW) {
IncludeOptions.getOptions(request, true).forceSameContext(Boolean.TRUE);
}
Views
Replies
Total Likes
Yes ! You can also refer [1] for the actual statement
[1] http://adobeaemclub.com/how-to-remove-default-div-generated-by-cq5-aem-for-component/
Views
Replies
Total Likes
Sorry, that approach is not working.
Views
Replies
Total Likes
You probably just have it wrong.
<% if (WCMMode.fromRequest(request) == WCMMode.EDIT || WCMMode.fromRequest(request) == WCMMode.DESIGN) { %> <c:forEach begin="0" end="${selectList-1}" varStatus="loopSubmenu"> <sling:include path="submenu_${loopSubmenu.index}" resourceType="aemdevcenter/components/content/global-header/submenu" /> </c:forEach> <% } else { %> <c:forEach begin="0" end="${selectList-1}" varStatus="loopSubmenu"> <sling:include cq:noDecoration="true" path="submenu_${loopSubmenu.index}" resourceType="aemdevcenter/components/content/global-header/submenu" /> </c:forEach> <% } %>
Views
Replies
Total Likes
Views
Like
Replies
Views
Likes
Replies