Copied to clipboard

Flag this post as spam?

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


  • Profiterole 232 posts 264 karma points
    Feb 14, 2011 @ 16:00
    Profiterole
    0

    Redirect to most recent

    Hi guys,

    Under Home, I have a node named News and under News I haves lots of nodes. If someone go to News (a textpage), I'd like the user to be redireted to most recent child.

    Do you have an idea on how to do that?

    Thank you

  • Jason Prothero 422 posts 1243 karma points MVP c-trib
    Feb 14, 2011 @ 17:41
    Jason Prothero
    0

    Take a look at this thread: http://our.umbraco.org/forum/developers/xslt/2834-Redirect-to-first-child-node-in-xslt

     

    Does that work for you? 

    Another option would be to create a user control that does the redirect.

  • Profiterole 232 posts 264 karma points
    Feb 14, 2011 @ 22:16
    Profiterole
    0

    Yeah, I already read that and this is not what I wanted. It load the content from another node or it goes to child just under. But for me, the newest node is not necessarly directly under. So I use javascript like this :

    <xsl:for-each select="umbraco.library:GetXmlNodeById($sourceJAP)/node">
    <xsl:sort select="data[@alias = 'japDate']" order="descending" />
        <xsl:if test="position() = 1">
          <SCRIPT language="JavaScript">
            <xsl:text>window.location="</xsl:text><xsl:value-of select="umbraco.library:NiceUrl(@id)"/><xsl:text>";</xsl:text>
          </SCRIPT>
    </xsl:if>
    </xsl:for-each>

    But thanks for help!

Please Sign in or register to post replies

Write your reply to:

Draft