I inherited some code from another agency that looks like this
if (WCMMode.fromRequest(request) != WCMMode.EDIT && WCMMode.fromRequest(request) != WCMMode.DESIGN && null != componentContext ) { componentContext.setDecorate(false); componentContext.setDecorationTagName(""); componentContext.setDefaultDecorationTagName(""); }
to prevent CQ from auto-generating divs around components. It's in the page's body.jsp, and seems to affect the entire site. I like the results I've seen - are there any gotchas I should be aware of?
Solved! Go to Solution.
Hi,
I think this is the correct way to do it until you are not fine with applying it on complete page. If you think you don't require to certain areas of pages or want to go case by case then you can go more deep and apply this to each component rendering (scriptlet).
Thanks,
Pawan
Hi,
I think this is the correct way to do it until you are not fine with applying it on complete page. If you think you don't require to certain areas of pages or want to go case by case then you can go more deep and apply this to each component rendering (scriptlet).
Thanks,
Pawan
Might not be directly relevant to your original question, but relevant to this topic of the decorated div. Look at IncludeOptions for controlling decoration of the next component from within code.
http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/wcm/api/components/IncludeOptions.html
See below for some further conversation on this:
http://forums.adobe.com/thread/1229101
You could also set this when creating specific components as a property on the component itself. This would then control just the ones you want instead of globally. But I guess that's entirely up to you :)
/Johan
Views
Likes
Replies
Views
Likes
Replies