We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21778
    • 223 Posts
    Using ditto to output my newsblog and everything is good! Except one minor detail i would love to get function;D

    What i have and what im trying to accomplish:

    I currently have a typical news-page setup. The latest "news-document" automatically position itself on top of the others (according to date), and they all have title, author, date and summary.

    What im trying to accomplish is having the latest news-document display as it currently dose (title, author, date, summary) but i want all other news to only show headlines. So i get a main-news-box with the latest article, and an older-news-box containing a list of headlines for the older news. Hope this makes sense.

    Currently i have tryed using two ditto calls, but i can’t see any way to make the older-news-box not output the latest article.
    Maybe Reflect snippet is what i need?

    Thanks smiley
      • 9130
      • 171 Posts
      In your older-news-box ditto call you need to use the "tpl" parameter to define a different chunk to use for formatting the output, something like this:
      [ditto &tpl=`myNewsChunk`...&your other parameters here... ]


      And create a new chunk named myNewsChunk with the html you want to output for each news item, for example:
      <span class="old_news_item"><a href="[+url+]" [+link_attributes+] >[+pagetitle+]</a></span>
      
        • 21778
        • 223 Posts
        Alright i see where your getting, but that way my latest newspost will also show in older-news-box or what? =)

        Experimenting with it now!
          • 9130
          • 171 Posts
          Oh, I missed that part.

          You could use the start parameter in your older-news-box ditto call and set it to 1 so it will skip one (the first) document. Another option is to use only one ditto call for everything and give the first document different formatting using the tplFirst parameter.

          See the full list of ditto parameters here.
            • 21778
            • 223 Posts
            Quote from: etal at Apr 21, 2009, 10:41 AM

            Oh, I missed that part.

            You could use the start parameter in your older-news-box ditto call and set it to 1 so it will skip one (the first) document. Another option is to use only one ditto call for everything and give the first document different formatting using the tplFirst parameter.

            See the full list of ditto parameters here.

            HaHa, im stunned i did not think of the "One ditto call solution" ! Must be my lack of coffe.

            Anyways, think i can figure something out now with your input. Thanks man, very cool.