Copied to clipboard

Flag this post as spam?

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


  • dominik 711 posts 733 karma points
    Jan 19, 2011 @ 12:01
    dominik
    0

    RSS Feed nodes are not displayed

    Hello,

    I just created a rss feed like it is described in the video.

    the xslt uses:

    <xsl:for-each select="$currentPage/node">

    (like it is done in the video)

    But no items are displayed. I only get a blank RSS site with the site name but without any items (news)

     

    Can somebody help?

    Thanks

  • Tom Smith 98 posts 172 karma points
    Jan 19, 2011 @ 12:09
    Tom Smith
    1

    Which version of Umbraco are you running?

    The xml scheema has changed in 4.5.2 so you may need to use somthing like

    <xsl:for-each select="currentPage/self::BlogPost">

    If you want to iterate over blog post nodes for example.

    Alternatively this might also work;

    <xsl:for-each select="$currentPage//node [@alias = 'BlogPost']">

    Have you got a link to that video handy? It might be referencing an older version of Umbraco?

    Many Thanks,

    Tom

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jan 19, 2011 @ 21:50
    Kim Andersen
    1

    Hi Dominik.

    As Tom says the XML schema has changed in the newer versions of Umbraco. If you want to run through nodes with some diferent document types, you have to do like this:

    <xsl:for-each select="$currentPage/*[@isDoc]">

    And if you want to just run through nodes with a document type of "BlogPost", you must do like this:

    <xsl:for-each select="$currentPage/BlogPost">

    /Kim A

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 19, 2011 @ 23:00
    Dennis Aaen
    0

    Hi Dominik and others.

    I just took a look at this post. And really thought I knew the answer as Kim has written in his post. There is something I wonder. Because the way I have asked for a specific document type in Umbraco.

    Are as follows so I thought it would be

    <xsl:for-each select="$currentPage/child::* [@isDoc and self::BlogPost]">

    Maybe it's me who is wrong.
    /Dennis

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jan 20, 2011 @ 19:54
    Kim Andersen
    0

    Hi Dennis!

    Yeah, your code would work just as well as the other code. But there's no reason to write so much. The following two lines of code would run through the same nodes:

    <xsl:for-each select="$currentPage/child::* [@isDoc and self::BlogPost]">
    <xsl:for-each select="$currentPage/BlogPost">

    It's up to you how you want to write your code, but it's always nice to write less code if possible, right ;)

    /Kim A

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 20, 2011 @ 20:08
    Dennis Aaen
    0

    Hi Kim

    Yeah you are right.

    It's nice to write less code if possible ;)

    But I did not know that it was possible to just write

    <xsl:for-each select="$currentPage/BlogPost">

    So thanks Kim ! :)

    /Dennis

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jan 20, 2011 @ 20:17
    Kim Andersen
    0

    No problem Dennis.

    You can do this because of the way the new schema is structured. I looks something like this:

    <root id="-1">
    <HomePage id="1050" ... >
    <title>My HomePage title</title>
    <BlogPost id="XXXX" ... >
    <title>My first blogpost</title>
    <BlogPost>
    <BlogPost id="XXXX" ... >
    <title>My second blogpost</title>
    <BlogPost>
    etc.
    etc.
    </HomePage>
    </root>

    /Kim A

Please Sign in or register to post replies

Write your reply to:

Draft