Copied to clipboard

Flag this post as spam?

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


  • nickornotto 317 posts 679 karma points
    Sep 18, 2014 @ 15:26
    nickornotto
    0

    Strange... Node and DynamicNode don't read id

    I'm trying to pick up a node from supplied id so I use new Node() and new DynamicNode

    However none of it is working. See the code:

    @helper GetPriceRecursive(string nodeId)
    {
        int ni = Convert.ToInt32(nodeId);
        umbraco.NodeFactory.Node node = new umbraco.NodeFactory.Node(ni);
        @nodeId
        @(ni)
        <i>a</i>
        @node.Id
        <i>b</i>
        umbraco.MacroEngines.DynamicNode node1 = new umbraco.MacroEngines.DynamicNode(ni);
        @node1.Id
    }
    

    @ni and @nodeId display correct numeric value, eg. 1700

    But then @node.Id and @node1.Id display 0

    I sue both in my UmbracoTemplatePage view

    Any ideas?

  • Jeavon Leopold 3008 posts 13221 karma points MVP 7x admin c-trib
    Sep 19, 2014 @ 15:31
    Jeavon Leopold
    0

    Hi Eva,

    Before looking at your specific issue, why are you trying to use the legacy NodeFactory and DynamicNode in a MVC UmbracoTemplatePage View?

    We have IPublishedContent and DynamicPublished content for rendering published content now...?

    Jeavon

  • 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