We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    Don’t put any links in your chunk template. Whatever you put in the chunk template, that is what Ditto will display. The chunk should have all of the HTML framework, and just the placeholders for the data you want from the news item.

    You can tell Ditto to display some text from one or more random news items.

    The placeholders can be any of the document’s fields, such as pagetitle, introtext (summary) or even the content. And that’s only the beginning. It’s very flexible.

    For example:
    <div class="news-headline">[+longtitle+]</div>
    

    Style the news-headline class to have a bit of padding and margin at the bottom and with a bottom border, and you’d have a very nice little block. Set the Ditto parameter &display=`3` and it would do this for 3 news items.
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 17097
      • 41 Posts
      Quote from: sottwell at Jul 02, 2008, 01:26 AM

      Don’t put any links in your chunk template. Whatever you put in the chunk template, that is what Ditto will display. The chunk should have all of the HTML framework, and just the placeholders for the data you want from the news item.

      You can tell Ditto to display some text from one or more random news items.

      The placeholders can be any of the document’s fields, such as pagetitle, introtext (summary) or even the content. And that’s only the beginning. It’s very flexible.

      For example:
      <div class="news-headline">[+longtitle+]</div>
      

      Style the news-headline class to have a bit of padding and margin at the bottom and with a bottom border, and you’d have a very nice little block. Set the Ditto parameter &display=`3` and it would do this for 3 news items.


      Ok I know you gave me an example, but I have a hard time understanding what I should do.
      I created the chunk Nieuws2 and placed this in it:
      <div class="Nieuws2">
      Hier komt het laatste nieuws.</div>
      


      Then in the template I placed this code:
      [[Ditto? &startID=`2` &tpl=`Nieuws2`]]
      


      But then I get this error:
      &tpl either does not contain any placeholders or is an invalid chunk name, code block, or filename. Please check it.

      What am I doing wrong?
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Ok, we have a misunderstanding here.

        If you just want some arbitrary text, not from any of your news articles, then just put the text after the news button in your template. Or make a chunk with it, and put the {{chunkName}} tags where you want it. That has nothing at all to do with Ditto.

        Ditto is for displaying bits of individual news articles. (I wonder if the author ever used a real Ditto machine...the original hand-cranked version).
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 17097
          • 41 Posts
          Quote from: sottwell at Jul 02, 2008, 01:53 AM

          Ok, we have a misunderstanding here.

          If you just want some arbitrary text, not from any of your news articles, then just put the text after the news button in your template. Or make a chunk with it, and put the {{chunkName}} tags where you want it. That has nothing at all to do with Ditto.

          Ditto is for displaying bits of individual news articles. (I wonder if the author ever used a real Ditto machine...the original hand-cranked version).


          That’s it! I was thinking much too complicated. Thanks! grin