We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9995
    • 1,613 Posts
    fourroses666 Reply #1, 14 years ago
    I have a navigation like this:

    NEWS (id 6)
    - NEWS 2012 (id 7)
    - NEWS 2011 (id 8 )
    - NEWS 2010 (id 9)

    I use ditto to show last 5 news messages.
    [ ! Ditto? 
    &parents=`7`
    &total=`5` 
    &showPublishedOnly=`1` 
    &orderBy=`menuindex ASC` 
    &noResults=`<p>Nothing</p>` 
    &tpl=`nieuws-inhoud`
    ! ]


    But when its getting 2013 there will be a new resource and the last 5 news messages will be 2012 and not 2013. I don't want to change the parent 7, it needs to change automaticly.

    Is it possible with Ditto to auto grab lowest menuindex / toppage ?
      Evolution user, I like the back-end speed and simplicity smiley
      • 36416
      • 589 Posts
      Quote from: fourroses666 at Sep 10, 2012, 04:15 AM

      Is it possible with Ditto to auto grab lowest menuindex / toppage ?

      Try like this:
      &parents=`6` &depth=`2` &hideFolders=`1`

      But it is less than ideal to rely on menuindex in this occasion... use pub_date or createdon for chronological listing.
        • 16278
        • 928 Posts
        I'm not sure I understand the structure and ordering (new folders getting menu IDs? new items getting lower menuindex?) but I suspect you could achieve what you want by using multiple Parents and orderBy parameters as comma-delimited lists. That would give you a true "latest 5" when they cross the boundary between years - is that what you need?

        ??? KP
          • 9995
          • 1,613 Posts
          fourroses666 Reply #4, 14 years ago
          @Eoler, as long as the container is filled that works great, as far as I have tested wink , thx!
          @kp52, I dunno if I understand you hehe, the 2013 etc. id I don't know yet, might work if it looks for all resources in the main container but anyway Eolers way works for me.

          I rather have menuindex than publishdate but not sure what it does when there are more than 1 menuindex on a same number.
            Evolution user, I like the back-end speed and simplicity smiley