Render property with Dynamic Content

Member since: 2007

Hi,

Is there any function that renders a property with Dynamic Content from a ContentData to e.g. a string? I've tried the GetPropertyValue() extension without any luck.

#65026 Jan 17, 2013 18:50
  • Member since: 2007

    Bump! How do we render properties in code!?

    #65479 Jan 30, 2013 16:16
  • Member since: 2004

    If you call

    xhtmlString.ToHtmlString(); 

    it should give you the html output of the xhtmlstring (including dynamic content).

    #65488 Jan 30, 2013 16:55
  • Member since: 2007

    Ok, thanks. But there is no common way to render all type of properties?

    #65489 Jan 30, 2013 16:56
  • Member since: 2004

    In CMS7 we have separated rendering from data. So a given data migth be rendered in different ways depending on context (MVC, WebFomrs, UI hints, DisplayChannels etc). 

    And if you run MVC it is also conventions that comes to play when MVC chooses a template for a data instance (e.g. a property)

    In your case are you using MVC or WebForms? And in which context are you doing the rendering (are you execution on a webform page/ Mvc View)?

    #65492 Jan 30, 2013 17:15
  • Member since: 2007

    Hi and thanks.

    We're using webforms. How are UI hints considered when rendering a property within webforms? I know that tags are considered when rendering a content area with blocks and so on, but how does UI hints fits in here?

    If we're not passing in any principal to ToHtmlString(), does it take the current principal?

    #65888 Feb 13, 2013 13:44
  • Member since: 2007

    By the way,

    ((XhtmlString)innerProperty.Value).ToHtmlString();

    doesn't render the dynamic content.

    #65891 Feb 13, 2013 14:26