Copied to clipboard

Flag this post as spam?

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


  • Lee 1123 posts 3059 karma points
    Jan 13, 2010 @ 12:51
    Lee
    0

    How Would I Do This With The NodeFactory?

    I am playing with the umbraco.presentation.nodeFactory and trying to port some XSLT into .NET - I am currently looping through some nodes like so

    foreach (Node node in MyNodeList)

    But am a bit stuck here?  How would I do the equivalent of this in my .NET?

    <xsl:value-of select="umbraco.library:GetXmlNodeById(string(data [@alias = 'myalias']))/@nodeName"/>

    Any help appreciated :)

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Jan 13, 2010 @ 13:06
    Dirk De Grave
    0

    Hi Lee,

    Generic properties are available as... properties on the node object whereas custom properties can be retrieved as

    node.getProperty("propertyAlias").Value

    Equivalent for your xslt statement is

    using umbraco.presentation.nodeFactory;
    
    Node node = new Node(int.Parse(Node.GetCurrent().getProperty("myAlias").Value));
    string nodeName = node.Name;

     

    Hope this helps.

    Regards,

    /Dirk

  • Lee 1123 posts 3059 karma points
    Jan 13, 2010 @ 13:13
    Lee
    0

    Ahhhh so obvious when you see it :) ... Legend, thanks

  • 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