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

Forums / Designing with Sitefinity / <p> and <br> tags not working

&lt;p&gt; and &lt;br&gt; tags not working

8 posts, 1 answered
  1. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    17 Aug 2009
    Link to this post

    So, i create a generic content. Type in one libe press endter type in another line press enter etc. And get this in the editor:

    Test

    Test

    Test

    The code behind looke like that:
    <p>Test</p>
    <p>Test</p>
    <p>Test</p>
    <p>&nbsp;</p>

    The view (preview shows it correctly)

    However when i actually use the item inside a page.  There are no breaks between the lines.
    The 3 lines are directly bellow each other as if i used <br/> instead of <p>

    Why is that? And how can i change that?

  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    17 Aug 2009
    Link to this post
    Hi Andrew,

    Thank you for using our services.

    The behavior you are getting should be coming from the fact that your RadEditor has the NewLineBr="true" property set. You can check in the control template the server tags for the RadEditor you this property is set to true. If you set it to false it will not change your <p> tags and produce the desired output. You can find more information on this property by looking at the following article - Using the NewLineBr Property.

    If you have more questions, please feel free to contact us.

    Sincerely yours,
    Rado
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    18 Aug 2009
    Link to this post

    Are you referring to the radeditor in this page: root/sitefinity/admin/generic_content/contenteditview.ascx?

    If so, the value is set to false. So it should not change it.

    In fact i can confirm it does not make any changes.

    As you can see in my previous post, the html looks perfectly fine. It also looks fine in the view tab inside the general content module area.

    However when opening the page in life view or view from the edit pages area. It displays the content incorrectly.

    It is not the writing of the html, but rather the interpreting that is a problem.

  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    18 Aug 2009
    Link to this post
    Hello Andrew,

    Thank you for getting back to me.

    This is strange behavior. I have attached a couple of screenshots to demonstrate how the editor generates the HTML in edit mode, and then how HTML is rendered in live site.  The screen shots are from Sitefinity 3.6 SP2, but the behavior is the same for Sitefinity 3.7.

    Can you tell us which version of Sitefinity are you using, and in what browsers you are editing and viewing the content? This is also important browsers handle render the HTML from rich text editors (such as the RadEditor) differently.

    Kind regards,
    Rado
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  5. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    18 Aug 2009
    Link to this post
    I am using Sitefinity 3.7
    And editing the pages with IE8
    Viewwing the pages in IE8 and Firefox 3
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    19 Aug 2009
    Link to this post
    Hello Andrew,

    Thank you for coming back to us.

    We have taken a further look into the issue and it appears to be coming from a CSS style rule in the themes. If you take a look in the styles of the themes you will see that in the rules for the themes there is a:

    * {margin:0;padding:0} 

    rule that is causing the undesired appearance. Can remove the margin rule and see what the result will be.

    We are looking forward to see how it goes on your side.

    Best wishes,
    Rado
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
    Answered
  7. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    19 Aug 2009
    Link to this post

    Yes!
    That is exactly what was doing it.
    Unfortunately i will need this in my style sheet, at least for this project since everything is build around the fact that it exists. i guess i will need to deal with the fact that i need to press enter twice when i want to get next paragraph.



  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    19 Aug 2009
    Link to this post
    Hi Andrew,

    As a workaround I could suggest that you use the margin rule only in content areas where you really need it, and remove it from being a global rule. This will prevent it from being applied to the main content areas and apply it to others where needed.

    Kind regards,
    Rado
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
Register for webinar
8 posts, 1 answered