


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
Views
Replies
Sign in to like this content
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
Sign in to like this content
Total Likes
Views
Replies
Sign in to like this content
Total Likes
When I try to use either cq:noDecoration or cq:cellName(empty) I lose the ability to author the component.
Views
Replies
Sign in to like this content
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
Sign in to like this content
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
Sign in to like this content
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
Sign in to like this content
Total Likes
Sorry, that approach is not working.
Views
Replies
Sign in to like this content
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
Sign in to like this content
Total Likes