Copied to clipboard

Flag this post as spam?

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


  • daniel 5 posts 38 karma points
    Jun 21, 2011 @ 18:58
    daniel
    0

    Get latest page under another page

    Hi.

    I have the following structure:

    Blog
    - post1
    - post2
    - post3

    When I now add another post under Blog I would like to take that post and present it on the Blog page.

    So the latest post under blog is always presented on Blog.

    thanks!

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jun 21, 2011 @ 20:11
    Kim Andersen
    1

    Hi Daniel

    Do you have some code already?

    You probably need to run through the nodes to see which one is the newest one. Something like this should work I think:

    <xsl:for-each select="$currentPage/*[@isDoc]">
    <xsl:sort data-type="text" select="@createDate" order="descending" />

    <xsl:if test="position() = '1'">
    <a href="{umbraco.library:NiceUrl(@id)}"><xls:value-of select="@nodeName" /></a>
    </xsl:if>
    </xsl:for-each>

    I think something like the above code should do the work...

    /Kim A

  • Amir Khan 1284 posts 2741 karma points
    Jun 21, 2011 @ 20:29
    Amir Khan
    0

    If you want all of the general blog-like functionality in addition you could also just use one of the blog packages: http://our.umbraco.org/projects/collaboration/blog-4-umbraco

  • daniel 5 posts 38 karma points
    Jun 28, 2011 @ 13:24
    daniel
    0

    Is there a way to do this in .NET and not in XSLT ?

    Not that I couldn't implement it in XSLT but just curious to know if it's possible.

    thanks

Please Sign in or register to post replies

Write your reply to:

Draft