Hi,
I've been evaluating CQ5 for the last week, and one of my key desires (at this stage) is to be able to modify the values added to the class attribute of the "decoration tags" that are wrapped around the components when they are rendered - this will be important in being able to offer a responsive design experience in edit mode...
The options I have explored are:
Adding cq:noDecorate to the components - this removes the decoration tag and the associated JavaScript, which, while I can then add my own wrapping decoration, I need the associated JS in order to actually perform the edit functions.
Adding cq:htmlTag + cg:tagName + class nodes/attributes to the components - this provides what I need, in that I can define the wrapping tag name and add a class to the tag and the JS is still generated. However, this is applied at a configuration level - I need this to be possible on the fly (as the actual class name to be added will be user configurable).
So, as I understand it, you can turn off decoration programatically using componentContext.setDecorate(false); which is supposed to the equivalent to cq:noDecoration. And it is - with the buggy exception that it doesn't remove the opening decoration tag... This then causes all sorts of nested mess. As mentioned above this wouldn't work for me anyway as the JS is removed too and I need this.
The next step was to try componentContext.setDecorationTagName("mytag"); to see whether there is a way to hook into the decoration tags this way.
Using componentContext.setDecorationTagName(""); is supposed to remove the decoration tags. What is appears to do is again only remove the closing tag! It does however leave the JavaScript, and whilst I can manually close the decoration block, I still can't modify the opening tag - which is the actual aim.
Incidentally, using componentContext.setDecorationTagName("mytag"); simply changes the closing tag to "</mytag>" and again it leaves the JS and the opening tag detail untouched.
This area feels very buggy to me and as a new CQ user it raises concerns that this is indicative of CQ5 as a whole - Would this be fair or am I missing something?
Regards
James