Hey, i am trying to create a comment system on my site and i would like to create something like reply button that would create something like block qoute with text contained in comment that user decided to reply to.
I have created some simple style i will use for this and now i am struggling with how can i actualy do this... Ive been searching over the net for a solution or a plugin but no luck.
How can i make cke to render my custom style in wysiwyg/preview mode? I have tryed to include it in a root stylesheet but its not picked up. Embeding actual reply data into editor would be another problem but i thnk that jquery can do something with iframes that are on the same domain so this should not be that much of a problem. Thanks for helping me.
update: Looks like that referencing that iframe directly does not work. This should do it but its acting like it the iframe is on a diferent domain. $(".cke_wysiwyg_frame").contents().find(".cke_editable").html("lorem ipsum"); So i tryed to reference that source texta area $(".source-area-class").html('<blockquote class="reply"> <p>'+body+'</p> <small class="pull-right">'+author+'</small> </blockquote>'); and its working. So half of a job looks like to be finished.
second update: So i have created backed of the comment system and also got some styles. Jquery part like scrolling and creating my qoute variable is working fine too. The only problem is that i cannot manage to put my code into the editor. When i was testing it and putting placeholder test qoute as a content of that source text area everything worked fine however when i do in on a user event eq click reply button than its just placed inside that text area but ckeditor is empty. Any idea?
third update: In the docs i found this. The editor instance name. It may be the replaced element ID, name, or a default name using the progressive counter (editor1
, editor2
, ...). However i cannot get that instance when i use progressive counter eq editor1 and so on. Its working when i define it by name or id (really dont know which one its picking up since they are both the same). However i want to be able to get this dynamically based on some class or that progressive counter. What am i missing?
another update: When i use this CKEDITOR.instances.comment.setData(qoute_body); in my jquery script to inser qoute data to the cke i got it there but editor adds unwanted <p> </p> into my qoute_body. How can i get rid of it automatically? For now ive created simple back-end regex to replace it with '' but i would like it to stop inserting it to the editor since it can confuse my users and its not intended behavior. Ive been searching over the net and docs and found this config.autoParagraph = false; config.fillEmptyBlocks = false; config.IgnoreEmptyParagraphValue = true; However its not exactly what i need. What i want is to editor insert it as its in my jquery variable. Something like raw insert or so for this quote but i does not find anything like that on the net. Can anyone help me please?