Copied to clipboard

Flag this post as spam?

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


  • Amir Khan 1287 posts 2744 karma points
    Feb 24, 2016 @ 18:43
    Amir Khan
    0

    List pages of mutliple document types in multisite environment

    Hi,

    I'm trying to list pages of a few different doc types from a multi site environment. I can't seem to get the root node of the installation though.

    Anyone know the correct version of " var root = Library.NodeById(-1);" for MVC?

  • Marc Goodson 2157 posts 14411 karma points MVP 9x c-trib
    Feb 26, 2016 @ 00:34
    Marc Goodson
    0

    Hi Amir

    var siteHome = Model.Content.AncestorOrSelf(1);
    

    Will get you the homepage node of the particular site you are in, within a multi-site environment and..

    var homePages = Umbraco.TypedContentAtRoot();

    will get you an IEnumerable of IPublishedContent containing the homepage of each site...

    if that helps?

    regards

    Marc

  • Amir Khan 1287 posts 2744 karma points
    Apr 01, 2016 @ 19:14
    Amir Khan
    0

    Hi Marc, sorry for the super late reply, I'm trying to list multiple document types from many sites. So basically what I'm trying to do is look at an entire umbraco installation and iterate through items of documenttype1, documenttype2 and documenttype3 at the same time.

    -Amir

Please Sign in or register to post replies

Write your reply to:

Draft