Copied to clipboard

Flag this post as spam?

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


  • Andrew Blackmore 84 posts 127 karma points
    Aug 04, 2010 @ 16:47
    Andrew Blackmore
    0

    Multiple Site Feeds with Same Template

    Had to figure this out myself so thought the info might help someone else. I am working on a site that hosts 6 blogs. They all use the same template with an XSLT Macro just to pick a different stylesheet for each blog. I ran into a problem with this package that you must pick a Root Node for the feed associated with each template.

     

    This works great for the homepage, but not so well with the situation I have described. I made a new Macro for RSS Collector that is the same as the original except for this:

    I replaced this line:

    <xsl:variable name="Root" select="umbraco.library:GetXmlNodeById(/macro/RSSRoot)" />

    With this one:

    <xsl:variable name="Root" select="$currentPage/ancestor-or-self::node [@nodeTypeAlias = 'Blog']" />

    This makes the macro just pick the feed for the parent blog of whatever page they are on. Hope this helps someone.

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Aug 04, 2010 @ 17:03
    Matt Brailsford
    0

    Hi Andrew,

    You could have also made your macro parameter recursive

    <umbraco:macro alias="rss" rssroot="[$myPropertyAlias]" runat="server" />

     This would check the current doc type for a property called "myPropertyAlias" and if it didn't find it, navigate up the tree untill it does.

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft