3 Replies Latest reply on Jun 24, 2016 11:29 PM by Nevermore Terminator

    rich:editor how to remove the <p>

    asaf zinger Newbie

      Hi,

      I'm using  richfaces 3.3.1, I dont want that every enter will create a new paragraph. (<p>)

       

      how can I cancel this default behaviour?

        • 1. Re: rich:editor how to remove the <p>
          Ilya Shaikovsky Master
          This is behavior of tinyMCE original widget. And we do not changed widget client side functionality but just wrapped it to JSF components. So please check tineMCE resources on such qeuestions.
          • 2. Re: rich:editor how to remove the <p>
            asaf zinger Newbie

            Well I think that as a java developers, and espcially JSF developers that wants to use richfaces components without even care about the underline components this forums is exactly the place to ask and answer such questions.

             

            But since my question was not answered I needed to dig in and find the solution myself. so here is the solution for future use:

            I found a site with all the tinyMCE possible configurations: http://wiki.moxiecode.com/index.php/TinyMCE:Configuration

             

            you can use the rich:editor f:param child element to define the tinyMCE configureation

            for example if you want to disable the paragraph addition after every enter you can use:

            <rich:editor ...>

                 <f:param name="force_p_newlines " value="false"/>

                <f:param name="force_br_newlines " value="true"/>

                <f:param name="forced_root_block " value=""/>

            </rich:editor>

             

             

            If you want to set CSS style for the inner editor panel you need to define the css file using another param element:

             

            <rich:editor ...>

                 <f:param name="content_css" value="[the css file path]"/>

            </rich:editor>

             

            In the CSS you can set things like the font style (size, color)

            • 3. Re: rich:editor how to remove the <p>
              Nevermore Terminator Newbie

              thank you, guy
              so kind of you GGWP