Copied to clipboard

Flag this post as spam?

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


  • Carl Sargunar 69 posts 91 karma points MVP 4x
    Jul 07, 2010 @ 13:58
    Carl Sargunar
    0

    Single List of content from two different folders - multisite implementation

    Hi

     

    I want to create a news summary for a umbraco implementation I'm working on with multiple sites. I have a top level global content folder and then multiple sites, and want to be able to create news stories both globally and locally

    the problem I'm having is that I am able to list both global and local news for each site, but they appear as separate lists. Is there any way anyone knows of usnig a single xslt to select 'news' content from both the global folder and the local folder within an XSLT, combine both lists, sort according to create date and output a single list

     

    thanks,

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Jul 07, 2010 @ 14:06
    Thomas Höhler
    0

    If the news are stored in nodes with a specific doctype it is easy. Just say you have a doc type called "NewsItem" then you can make something like this:

    <xsl:for-each select="$currentPage/ancestor-or-self::root/descendant-or-self::node [@nodeTypeAlias = 'NewsItem']">
    <xsl:sort ....

    hth, Thomas

  • Carl Sargunar 69 posts 91 karma points MVP 4x
    Jul 07, 2010 @ 15:27
    Carl Sargunar
    0

    Hi Thomas

    Thanks for the reply. That would work in one situation, but I have one global content site and many local sites all of which have their own local news that must not be shared The xpath you specified in your foreach would I think select all nodes of that type within all sites, but I only want to pick nodes from the local site and from the global folder

    i.e

    o Global Folders

    o Site 1

    o Site 2

    Site 1 should only see it's news and the global news, and same for site 2

     

    thanks,

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Jul 07, 2010 @ 15:58
    Thomas Höhler
    0

    ahh ok, then try something like this one: 

    <xsl:variable name="SiteNodeName" select="$currentPage/ancestor-or-self::node [@level = 1]/@nodeNamen>">xsl:variable>
    <xsl:for-each select="$currentPage/ancestor-or-self::root/node [@nodeName = 'GlobalFolders' or @nodeName = $SiteNodeName]/descendant-or-self::node [@nodeTypeAlias = 'NewsItem']">xsl:for-each>

    hth, Thomas


  • Thomas Höhler 1237 posts 1709 karma points MVP
    Jul 08, 2010 @ 08:59
    Thomas Höhler
    0

    Did this work?

    Cheers, Thomas

Please Sign in or register to post replies

Write your reply to:

Draft