ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

rich text editor on comment form

June 25, 2012 9:41pm

Subscribe [2]
  • #1 / Jun 25, 2012 9:41pm

    elwed

    151 posts

    After a hiatus of a few years, I decided to start a few new blogs.

    One problem I can’t figure out by myself concerns the RTE module. It should be possible to use the RTE for comments on the front side, right?

    I followed the instructions, i.e added the script tag to the page’s head element and made sure that the textarea has a class that RTE triggers on. After doing that, RTE displays on the page, but there are two problems.

    The paragraph break is much longer than in the CP. I’m just curious why, that’s all. It would be nice to fix, but this is only a very minor issue.

    The showstopper is that RTE doesn’t seem to send the input back to the form. Show Code results in an empty textarea, submitting or previewing fails because the textarea is empty.

    I have tried FF and Chrome with the same result, or lack thereof.

    Hopfully I’m just missing something obvious, like glossing over some important bit in the documentation.

  • #2 / Jun 27, 2012 10:58am

    Dan Decker

    7338 posts

    Hi elwed,

    Welcome back!

    Just for clarity, which version of 2.5 are you using?

    Hopfully I’m just missing something obvious, like glossing over some important bit in the documentation.

    While it isn’t covered explicitly in the User Guide, the RTE likes the class assigned to be “.rte”. This bit has been reported as a bug and the Devs are working to make it more flexible.

    Can you try naming your RTE class “.rte” and let me know the results?

    Cheers,

  • #3 / Jun 27, 2012 11:38am

    elwed

    151 posts

    I’m using 2.5.2 - Build Date: 20120606.

    I believe I have figured it out, though.

    Wrong:

    
      Comment: 
    
      <textarea ....class="something stylish">{comment}</textarea>
    


    Seems to work:

    
      Comment: 
    
      <textarea ... class="rte">{comment}</textarea>
    

    The bad code flunks jQuery 101 and in hindsight, the failure mode is blindingly obvious. Still, where the RTE manual says “For example, to load the RTE’s JavaScript via a template and apply it to all elements with the class “my-class””, it could be explicit about applying the class to textarea tags only 😊

     

     

  • #4 / Jun 29, 2012 3:30pm

    Dan Decker

    7338 posts

    Hi elwed,

    Indeed, you are correct! That certainly could be more clear in the User Guide.

    I’ll get the User Guide corrected! Thanks for your input.

    Is there anything else I can assist you with?

    Cheers!

  • #5 / Jun 29, 2012 7:16pm

    elwed

    151 posts

    No, I’m good for now. Thanks for pointing me in the right direction.

  • #6 / Jul 02, 2012 4:01pm

    Shane Eckert

    7174 posts

    Hi elwed,

    I am glad that Dan was able to help you out!

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases