Copied to clipboard

Flag this post as spam?

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


  • Otto 9 posts 78 karma points
    Oct 15, 2015 @ 08:06
    Otto
    0

    how can I get in C# the elements from multi node tree picker umbraco

    Hello!

    I have a blog and this blog have some labels have a ucomponent with multinodetreepicker I can choose some of them depending on the post. I want to get these labels in C #, and doing a li ul and to show in my frontend .

    Any suggestion ?

  • Otto 9 posts 78 karma points
    Oct 16, 2015 @ 11:07
    Otto
    0

    I' ve got this XML struct:

     <tagging>
                    <MultiNodePicker>
                      <nodeId>119683</nodeId>
                      <nodeId>119684</nodeId>
                    </MultiNodePicker>
                  </tagging
    

    And I need to get the names of the nodeID's I tried to use:

    @using umbraco.MacroEngines
    @inherits DynamicNodeContext
    @if (Model.HasValue("tagging"))
    {
        <ul>
        @foreach (var item in Model.tagging)
        {
            var node = Library.NodeById(item.InnerText);
            if (node.Id != 0)
            {
                <li>@node.Name></li>
            }
        }
        </ul>
    }     
    

    but doesn't work, maybe I have written something wrong.

    Anyone?

Please Sign in or register to post replies

Write your reply to:

Draft