Copied to clipboard

Flag this post as spam?

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


  • ThomasBrunbjerg 86 posts 178 karma points
    Aug 18, 2017 @ 11:29
    ThomasBrunbjerg
    0

    Adding classes to item.GetPropertyValue() auto-generated p elements

    It seems whenever I call the GetPropertyValue() function, a p elements is automatically generated, meaning I can't wrap my call in my own implemented p element. I need to add a few classes to this element, but I am unable to, as the auto generated element is only created at runtime.

    This is my call:

    @(item.GetPropertyValue("desscription"))

    When i wrap this in a p element with a class like this:

    <p class="static-heigth">@(item.GetPropertyValue("desscription"))</p>
    

    The browser adds an empty p element, as well as a p element containing a span with my property string.

    How do I add classes and data-types to p elements containing my property values?

  • Dan Diplo 1505 posts 5911 karma points MVP 4x c-trib
    Aug 18, 2017 @ 12:37
    Dan Diplo
    0

    If your description field is a rich-text editor then it will return your content as HTML, including paragraph tags, headings etc.. So you don't want to wrap rich-text content in P tags. Use a div or something else more semantically suited.

    If you want just plain text, then use a textbox or textarea instead of the rich-text editor.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies