Copied to clipboard

Flag this post as spam?

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


  • AlexRamsey 4 posts 24 karma points
    Dec 07, 2012 @ 09:08
    AlexRamsey
    0

    Multi-Url Picker recursive changes

    Hi,

    I have a node with a property which uses a datatype of type Multi-Url Picker.

    In a previous version of umbraco I was able to do the following to retrieve the values from the data type recursively:

    dynamic relatedLinks = Model._relatedLinks.urlpicker;

    The XML generated by the Multi-Url Picker was formatted in the following way:

    <multiurlpicker>
      <urlpicker mode="Content">
        <newwindow>False</newwindow>
        <nodeid>1062</nodeid>
        <url>/working-with-us/</url>
        <linktitle>About us</linktitle>
      </urlpicker>
    </multiurlpicker>

    I am now unable to use the same code in the current version of Umbraco (4.11.1) because the XML has now changed and trying to use the above code will cause errors:

    The new XML generated by the Multi-Url Picker:

    <multi-url-picker>
      <url-picker mode="Content">
        <new-window>False</new-window>
        <node-id>1061</node-id>
        <url>/community/</url>
        <link-title />
      </url-picker>
    </multi-url-picker>

    Can anyone suggest an alternative method to retrieve the values from the data type recursively?

  • AlexRamsey 4 posts 24 karma points
    Dec 07, 2012 @ 09:53
    AlexRamsey
    0

    Also just looking at the Current page Model that has an empty Multi-Url Picker datatype, it doesn't appear that it would be considered as null or an empty string as the Value property is always set to:

    "<multi-url-picker />"

    Even when there are no values entered.

    Which might explain why standard recursion can't be used.

     

Please Sign in or register to post replies

Write your reply to:

Draft