Copied to clipboard

Flag this post as spam?

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


  • dp_sbbs 25 posts 20 karma points
    Jan 20, 2009 @ 15:45
    dp_sbbs
    0

    Get latest node id by @updateDate

    I'm trying to get the latest nodeid in a tree sorted by @updateDate, but I can't get it right.

    This is what I got:

    [code]





    [/code]

    But this only gets the latest node by createDate, I want by updateDate.

    Note that I need to use the latestArticle variable on several places and I can't use a for-each loop with a sort.

    Does anybody have an idea?

  • Finn 86 posts 50 karma points
    Jan 20, 2009 @ 17:04
    Finn
    0

    In my opinion you can’t use last() because you don’t know if the last updated node is the last! You need a for-each loop. Maybe something like this can help you on the way:





    Hope it helps.

    /Finn

  • dp_sbbs 25 posts 20 karma points
    Jan 20, 2009 @ 17:45
    dp_sbbs
    0

    A for-each-loop is not an option since I need to use the nodeId of the latest updated/published node in several places in my xslt.

    In the same xslt I need to get the nodeid of a node in a different archive folder with a different nodetypealias.

    When I have gotten the both nodes from the different archive folders I need to compare which of these two is the latest and then I will output the latest one.


    [code]









    [/code]

  • Stephan Lonntorp 195 posts 212 karma points
    Jan 20, 2009 @ 22:15
    Stephan Lonntorp
    0

    [code]

    [/code]

    the variable lastUpdatedNode should now contain your last updated node.

  • dp_sbbs 25 posts 20 karma points
    Jan 21, 2009 @ 08:49
    dp_sbbs
    0

    If I write:

    [code]

    [/code]

    Then I get nothing in the output

  • Stephan Lonntorp 195 posts 212 karma points
    Jan 21, 2009 @ 12:23
    Stephan Lonntorp
    0

    and if you write:
    [code]

    [/code]

    still noting?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies