+1-888-365-2779
Try Now
More in this section

Forums / Set-up & Installation / How do I make editor use p tags instead of br on pressing enter

How do I make editor use p tags instead of br on pressing enter

7 posts, 0 answered
  1. quixltd
    quixltd avatar
    6 posts
    Registered:
    06 Mar 2007
    29 May 2007
    Link to this post
    I think the title says it all.

    I'm completely new to Sitefinity and Telerik controls, so excuse my ignorance.

    When I press Enter in the Editor window it add a br tag so if I'm entering a heading, the next line appears as a heading rather than a paragraph. If I change the format to a paragraph, the heading also changes to a paragraph since the br is used when Enter is pressed.

    How do I change this behaviour as a default?

    TIA
    Tom Madden
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    08 Dec 2016
    30 May 2007
    Link to this post
    Hello Tom,

    You can use Insert New Paragraph button of the editor to insert <p> tags. This button is a part of DialogToolbar that can be configured from the ~/YourProject/Sitefinity/Admin/ControlTemplates/EditorToolsFile.xml file.

    <tools name="DialogToolbar" dockingZone="Left" enabled="true">
            <tool name="InsertParagraph" />
            <!--tool name="IncreaseSize" shortcut="F10"/>       
            <tool name="DecreaseSize" shortcut="F9"/>   
            <tool name="Print" shortcut="CTRL+P"/>   
            <tool name="Superscript" />
            <tool name="Subscript" />       
            <tool name="InsertHorizontalRule" />
            <tool name="InsertDate" />
            <tool name="InsertTime" />       
            <tool separator="true"/>       
            <tool name="AboutDialog" />
            <tool name="Help" shortcut="F1"/!-->
    </tools>

    I hope this will solve you problem.
    Please do not hesitate to contact us if you need any assistance.

    Regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Kevin Pipher
    Kevin Pipher avatar
    91 posts
    Registered:
    30 Nov 2005
    30 May 2007
    Link to this post
    Hi Tom,

    I also had this problem.  Another way to modify the behavior is to edit:
    ~/Sitefinity/Admin/ControlTemplates/EditorConfigFile.xml

    in the <configurationsection, change the "NewLineBr" property, as shown below:
     
    <property name="NewLineBr">false</property>

    This will cause the RadEditor to insert <p> tags instead of <br/>.

    Hope this helps.

    Kevin.
  4. marco pessina
    marco pessina avatar
    16 posts
    Registered:
    02 Nov 2009
    04 Aug 2010
    Link to this post
    Hi,
    I need the opposite behaviour: in Generic Content editor (but also in News, Events, ect.) when I press Enter, it write a <p> tag instead a <br /> tag. I have to use <br /> tag to preserve layout.

    In ~/Sitefinity/Admin/ControlTemplates/EditorConfigFile.xml doesn't exist a <configurationsection.

    Thank you,
    Marco
  5. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    06 Aug 2010
    Link to this post
    Hi marco pessina,

    You should edit the control templates of those controls which contain the RadEditor. There the RadEditor is set to use NewLineBr="false" you set this to true and map the control templates.

    Regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. marco pessina
    marco pessina avatar
    16 posts
    Registered:
    02 Nov 2009
    10 Aug 2010
    Link to this post
    Ok Georgiev,
    but in witch control I can found the Generic Content RadEditor?

    Thanks a lot,
    Marco
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    10 Aug 2010
    Link to this post
    Hello marco pessina,

    It depends on which instance of RadEditor control you want to modify. For instance the template for RadEditor control wrapped in GenericContent control is GenericContentDesigner.ascx. The RadEditor is declared in this template. You can download the template from your account >> downloads section >> external template. You can gather more information at How to map a template.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
7 posts, 0 answered