Copied to clipboard

Flag this post as spam?

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


  • Lee 1130 posts 3088 karma points
    Jan 13, 2010 @ 13:27
    Lee
    0

    Good Examples Of Using umbraco.presentation.nodeFactory?

    Wasn't sure where to put this, but was wondering if there are any good examples of using umbraco.presentation.nodeFactory?  I can't find anything on Umb.Tv or wiki just this page - http://our.umbraco.org/wiki/reference/api-cheatsheet/working-with-the-nodefactory

    I'm looking for examples of paging with lots of nodes?  Binding nodes to a datasource (If you can even do that?) and anything else interesting :) - Please post any links below

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Jan 13, 2010 @ 13:33
    Niels Hartvig
    0

    You can bind using the ChildrenAsTable() method on a Node object. Be aware that only children that matches the type of the first child will be used as the first child will work as the schema in the table. To get specific types of children there's an overload where you can specify a doctype filter.

    The nodefactory is a wrapper for the published xml and as such it got decent performance. However, it's nowhere near as fast as XSLT when coming to more advanced queries (because you have to filter everything yourself).

    Hope this helps!

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Jan 13, 2010 @ 13:39
    Thomas Höhler
    0

    My Simple Search for Umbraco uses the NodeFactory. So you can take a look into the code or use it: You can get a List<SearchItem> or a XpathNodeIterator back from the searcher.

    hth, Thomas

  • Lee 1130 posts 3088 karma points
    Jan 13, 2010 @ 13:59
    Lee
    0

    Thanks chaps - I'm 'really' trying to use XSLT everywhere, but each day I start to hate it more when I have to start doing more complex things.  This is why I was hoping this would be my saviour :(

    Awesome Thomas, going to download it now :)

Please Sign in or register to post replies

Write your reply to:

Draft