Copied to clipboard

Flag this post as spam?

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


  • Will Sanders 19 posts 39 karma points
    Jan 27, 2011 @ 20:38
    Will Sanders
    0

    NodeFactory question

    I've got a question about NodeFactory. From an example on Umbraco TV, I have the following code 

     

     

     using umbraco.presentation.nodeFactory;
    Node currentPage = Node.GetCurrent();
     foreach(Node page in currentPage.Children)
                {
                    Response.Write(page.Name);
                }

     

    However, it seems the Node class is obsolete.  So, I tried with the umbraco.NodeFactory class and I get an error - 

    The type 'umbraco.interfaces.INode' is defined in an assembly that is not referenced. You must add a reference to assembly 'interfaces, Version=1.0.4029.25827, Culture=neutral, PublicKeyToken=null'.

    My version info is: umbraco v 4.6.1 (Assembly version: 1.0.4029.25836)

    I know that there is a version mismatch but not sure what to do to correct it (or should I just go back to the obsolete method). 

    Thanks for any help.

  • Richard Soeteman 4049 posts 12922 karma points MVP 2x
    Jan 28, 2011 @ 00:05
    Richard Soeteman
    2

    Hi,

    You have to add a reference to the Interfaces dll also and then use umbraco.nodeFactory.

    Cheers,

    Richard

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jan 28, 2011 @ 03:06
    Aaron Powell
    0

    The INode interface was added in Juno so that an abstraction layer existed on NodeFactory and could be passed around

  • Will Sanders 19 posts 39 karma points
    Jan 28, 2011 @ 15:51
    Will Sanders
    0

    Awesome! That did the trick. Thanks guys! 

Please Sign in or register to post replies

Write your reply to:

Draft