Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Shahzad Ahamad 51 posts 251 karma points
    Feb 21, 2018 @ 14:23
    Shahzad Ahamad
    0

    Property value is appending paragraph tags at the end

    Hi ,

    I am new to umbraco . I created a document type then created a content node using that document type. But it is showing a wierd behaviour it is appending paragraph tags at the ends of each property value. PFB the screenshots of the content node and the webpage.

    Content Page

    Web Page

    Any help will be appreciable.

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Feb 21, 2018 @ 14:35
    Dan Diplo
    0

    If you use a rich-text editor then it will always wrap paragraphs in a <p> tag to ensure semantic correctness.

    If you just need to display plain text then use a textstring or textbox or multiple textbox input instead. See https://our.umbraco.org/Documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Textbox

    If you need HTML formatting but don't want the tags then you can try using the following helper method:

    @Umbraco.Field("fieldAlias", removeParagraphTags: true)
    

    Where "fieldAlias" is the alias of your RTE property.

  • Shahzad Ahamad 51 posts 251 karma points
    Feb 22, 2018 @ 06:46
    Shahzad Ahamad
    100

    Hi Dan Diplo,

    Thank you it worked. I used textstring for some fields and for text areas i used

    @Html.Raw(Model.HeaderText).

Please Sign in or register to post replies

Write your reply to:

Draft