Copied to clipboard

Flag this post as spam?

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


  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    Jul 30, 2010 @ 10:13
    Ali Sheikh Taheri
    0

    how can i get the latest item in auto folder?

    Thanks for your great package.

    I have a very simple question, here is the scenario :

    I have a news section and I used this package to have the folders by year and month.

    but there is a little problem when I click on the news section in navigation I would like to get the latest news. but it shows news.aspx which is empty.

    hope that make sense.

    any idea or help on this?

    Thanks in advance

    Ali Taheri

  • Chris Koiak 700 posts 2626 karma points
    Jul 30, 2010 @ 11:32
    Chris Koiak
    0

    You need to associate a template with the doctype for the News.aspx page. You'll probably have to do the same for the folders.

    You may want to think about changing your navigation to hide all folders andnews items, instead you would write a custom xslt on the News.aspx template to output all news items.

    Chris

  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    Jul 30, 2010 @ 11:44
    Ali Sheikh Taheri
    0

    Hi Chris,

    Thanks for your reply. its a good idea. consider the following structure in Umbraco content section

    - news section

    -2010

    - 07

    -news item 1 

    -news item 2

    -news item 3 

    what I would like to do is, when you click on news section on website (not content section in umbraco)  on navigation then it must dynamically picks up the latest news (news item 3).

    I think I need to create a function in c# and use it in xslt to get the latest news if the doctype is news .

    Am I right?

    Any Idea better than that?

    Cheers

    Ali

  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    Aug 06, 2010 @ 10:30
    Ali Sheikh Taheri
    0

    here is the solution:

    I have created a library with a funcation GetLatestNitems than I can use in XSLT.

    This function gets 2 parameters, the first one is NodeID and second one is number of requested items. the output will be a list of  nodes. ex (1109,1198,1243)

    then I can deal with the node ids.

    hope that's gonna be useful for others.

    Cheers

    Ali

Please Sign in or register to post replies

Write your reply to:

Draft