Problem with default settings for comments component.
Hello, I have next problem:
I need to set some default settings for comments component and I tried to do it in next way - I added node with name "comments" under the jcr:content of template of me page. When I create page, this "comments" node appears in /conent/mypagename/jcr:content/ but comments component does not work. If I delete this "comments" node, then set the same settings via edit dialog, node with the same properties appears and component works!
Also, as I found here - help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__srsa-hi_i_raisedane.html , node with name comments will not be replicated during page activation, and as I see it, it's done to prevent problem that I got with my properties.
Can anyone suggest me the way, how I can set some default setting for comments component?
Thank you.
UPD: when I put me comments component into the parsys it's properties were successfuly replicated with page. But why it was not working without parsys?
Also I want to add, that I overlayed basic component with my own (there some rendering changes), when I change resourceType to default one - it works ok, but when I change back to mine, when I am trying to post new comment in developers console I see "Uncaught Error: success" from the code:
CQ.soco.comments.attachToComposer = function(targetForm, appendTarget, templateName) { var success = function(data, status, jqxhr) { CQ.soco.filterHTMLFragment(data, function(node) { var newNode = node.appendTo(appendTarget); newNode.on(CQ.soco.comments.events.DELETE, CQ.soco.comments.removeHandler); newNode.on(CQ.soco.comments.events.ADDED, CQ.soco.comments.addHandler); }); targetForm.trigger(CQ.soco.comments.events.ADDED); targetForm.find("textarea").blur(); }; var failure = function(jqXHR, textStatus) { throw new Error(textStatus); // HERE the error was thrown }; CQ.soco.commons.clientSideComposer(targetForm, templateName, success, failure, {}); };
Any ideas?