Copied to clipboard

Flag this post as spam?

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


  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Nov 11, 2009 @ 12:39
    Tim
    0

    News Section

    Hi,

    I'm setting up a news section for a site, where I want the news articles to be grouped by year, with a latest news page that lists the latest news articles.

    Example structure:

    News (list most recent articles, say latest 10)

    -- -- 2009

    -- -- -- News Article 1

    -- -- -- News Article 2

    -- -- 2008

    -- -- -- News Article 1

    -- -- Other, non-news pages for contacts etc

    etc

    Assuming that I have a newslist datatype, and a news article datatype, would I be best off having the years as newslist datatypes, with news articles underneath, and then have the latest news articles as a page with a macro that looks for all news articles underneath it (if so, any pointers on the xslt syntax would be appreciated)?

    Or is there a better way of doing this?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 11, 2009 @ 12:49
    Jan Skovgaard
    0

    Hi TIm

    I would recommend that you take a look at either the autofolder package http://our.umbraco.org/projects/autofolders or the http://our.umbraco.org/projects/datefolder.

    I have not really tried the autofolder myself yet but it looks very promising and customisable, so you can basically make it do anything you would like.

    I have used the datefolder package a few times and it gives you a folder structure, which is almost identical to the one you have sketched above.

    If you use it you will get your articles sorted by year, month, day article like

    - 2009
    -- 11
    --- 11
    ---- News article 1
    ---- News article 2
    ---- Etc.

    You get all your news items organized down to the detail and you can easily pull out the nodes you want.

    All you need to do is specify under, which document types you want to add datefolders and they will be automatically created when you right click on your root document type and create a new document based on your news document type.

    Btw - Be carefull not confusing datatypes with document types - There's a big difference on those two. I think you have document types in mind, right? :)

    Hope this helps

    /Jan

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Nov 11, 2009 @ 13:00
    Tim
    0

    Hi Jan,

    Thanks for the reply!

    :)

    I've had a look at the datefolder package, do you know if it's possible to only group by year? This particular site only has a dozen or so news articles a year, so grouping by month and day would be overkill in this case. Also, we'd want the year url's to list all the articles underneath them, would it be able to do that as well?

    And yes, I meant document types, not data types, you can tell I'm new to Umbraco!

    :P

  • Sa 118 posts 152 karma points
    Nov 11, 2009 @ 13:14
  • Chris Koiak 700 posts 2626 karma points
    Nov 11, 2009 @ 14:57
    Chris Koiak
    1

    "possible to only group by year?"

    With DateFolder you can only group by yyyy/MM/dd. However with AutoFolders you can completely configure the format, but I think it does require a month folder. If you're only producing 12 articles a year to you really need auto creation of folders?

    "we'd want the year url's to list all the articles underneath them"

    I would create the primary and month pages are NewsList doctypes. This would allow the year pages to list the articles within them.

    Cheers,

    Chris

     

Please Sign in or register to post replies

Write your reply to:

Draft