Copied to clipboard

Flag this post as spam?

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


  • Simon Dingley 1474 posts 3451 karma points c-trib
    Sep 03, 2013 @ 12:56
    Simon Dingley
    0

    UrlPicker null when using Model.GetPropertyValue<UrlPickerState>("MyProp") in Umbraco v6.1.4

    Not sure if this is a bug or incompatability with this version of Umbraco but take the following code:

    contentItem.GetPropertyValue("link")
    

    This returns the following data:

    <url-picker mode="Content">
      <new-window>True</new-window>
      <node-id>1134</node-id>
      <url>/events/</url>
      <link-title>Example Banner</link-title>
    </url-picker>
    

    However, the following code returns a null value:

    contentItem.GetPropertyValue<UrlPickerState>("link");
    

    Am I going the wrong way about this?

    Thanks, Simon

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Sep 03, 2013 @ 13:59
    Jeroen Breuer
    100

    Hello,

    The UrlPickerState is not a Property Editor Value Converter so that won't work.

    Try this:

    var urlPickerState = UrlPickerState.Deserialize(content.GetPropertyValue<string>(alias));

    Jeroen

     

  • Simon Dingley 1474 posts 3451 karma points c-trib
    Sep 03, 2013 @ 14:00
    Simon Dingley
    0

    Thanks and marked as solution as discovered this earlier and implemented.

  • 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