Copied to clipboard

Flag this post as spam?

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


  • Nicky Christensen 76 posts 166 karma points
    Mar 06, 2014 @ 10:40
    Nicky Christensen
    0

    get values from Multinode Tree Picker

    Hey guys...

    Im getting some ID's from a multinode tree picker, and i want to loop each "selection" i made with the picker.

    Lets say i've chosen 2 pages from a multinode tree picker, then I want to loop these, and get the pageName of these...
    Right now im only getting the ID's of the selections, but I want to loop each, and then get the name, hope it makes sense

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    
    @{
        var getCategories = CurrentPage.category;
    }
    //Here I want to loop the categories, and display the pagename for the categories chosen
    

    <p>@getCategories</p> //This returns ex: 1131, 1029

    //Now we want to create a loop for each ID, and return the pageName
  • Charles Afford 1163 posts 1709 karma points
    Mar 10, 2014 @ 22:32
    Charles Afford
    0

    Hi i had the same problem.  What is being returned is XML

    So what you can do is get your property as string which will return something like <multinodetreepicker><nodeid>1001</nodeid>

    What you need to do is create a new XMLDocument

    XmlDocument mntpDocument = new XmlDocument(pass in your multi node picker property value);

    XmlNode node = mntpDocument.Child();

    foreach(XmlNode nodeIdNode in node.Child().InnerText())

    {

    nodeIdNode will now be the id with out the XML

    }

    You will need to do some work but this is the idea :).

    Hope this helps.

    Charlie

Please Sign in or register to post replies

Write your reply to:

Draft