We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4429
    • 429 Posts
    I need yet more help from you knowledgeable lot.

    I am in the process of creating my site and want to display news items in a number of areas.

    I have created a page as a container called "Latest News" within that container are "News","Events" and "Match Reports". These again are all containers each with documents (stories) inside them.

    I want it so when users click on "Latest News" it lists all news article headlines and teasers regardless of which sub catagory they are.

    I also want links to the "Events", "News" and "Match Report" pages as sub-items of "Latest News"


    Is this possible and how do I go about it please?

    Bare in mind i am new to Modx and despite reading the documentation - There was no clear consises step by step guide to using Ditto - I’m sure there will be given time.

    Thank you
      • 25663 MODX Staff
      • 12,272 Posts
      You might look at the ditto support site located at http://ditto.modxcms.com/ for more tips and insight. You should be able to to this easily with using multiple IDs in the &partents parameter.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 4429
        • 429 Posts
        [[Reflect? &dittoSnippetParameters=`startID:4` &groupByYears=`0` &showItems=0` &tplMonth=`reflect_month_tpl`]]


        That is ithe call I have my "Latest News" (id4) page which is the container for "news"(13), "Events"(15) and "Match Reports"(14).

        However this does not seem to work I presented with the following:

        No documents found.

        Showing - of Articles

        The Ditto object is invalid. Please check it.

        I’m not sure what exactly to change my call too.
          • 4429
          • 429 Posts
          Hi i’m still around and still very very stuck and confused with this.


          The setup is:

          1) "Latest News" is a container for the following
          --Match reports
          --Events
          --News

          These are also containers and hold stories.

          when clicking on the latest news page, I want links to each os the sub-folders e.g Events, Match Reports etc.. but I also want say headlines and teasers from the latest 3 stories to appear.

          Is this possible? How in the world I go about doing something like that?

          Please
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            The easiest way would be to have a Ditto call in the first page. Then in the template for the output, have another Ditto call (using a different template) to list the articles.
              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
              • 4429
              • 429 Posts
              Quote from: sottwell at Jul 25, 2008, 02:53 AM

              The easiest way would be to have a Ditto call in the first page. Then in the template for the output, have another Ditto call (using a different template) to list the articles.

              I am new to this, I don’t understand what to write to get the articles to show.

              I have checked the documentation but it assumes some knowledge, I really need a very basic beginners set-by-step approach.

              Imagine you were trying to explain it to your little sis ... that’s the level i’m probably at. :’(
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                On the main Latest News page, have a Ditto call. Tell it to use the LatestNewsTpl chunk as its template.

                In the LatestNewsTpl chunk have a Ditto call. Tell this Ditto to use a LatestNewsSectionTpl chunk, and in that chunk put the HTML code and Ditto placeholders to format the individual item listing as you wish.

                As an alternative, you could use three separate Ditto calls on the Latest News page, just specifying the parent for each call in the &parents= parameter.

                  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
                  • 4429
                  • 429 Posts
                  Slowly starting to get there.

                  On the Match Reports, Events, News contaiers I have the following Ditto call:

                  [[Ditto? parents=`13` &tpl=`tpl_Blog` ]] 


                  obviously the ID relates to each container.

                  Here is the output of ’tpl_Blog’

                   <h4><a href="[~[+id+]~]">[+date+] : [+title+] </a></h4>
                  <p>  </p>
                    <p>[+content+]</p>


                  This works fine and shows me the articles listed under those containers. There are however two problems:

                  1) It shows the article in full i.e it does not just list a headline and 20 word teaser
                  2) It only lists two articles on a page and there are no navigation for ’next’ or ’back’

                  The major problem:
                  3) WHen I use this call on the main news container i.e the page that contains the Match Reports, Events and News contains, it crashes the site.

                  I feel its not far off, can you help please.

                  Thanks
                    • 4749
                    • 623 Posts
                    Read the ditto support site like Ryan posted above. You’ll have to use &trunc parameters. For example:
                    &extenders=`summary` &trunc=`1` &truncLen=`100` &truncOffset=`10` &truncText=`...Read More`


                    Those parameters must be added to your Ditto call for it to Truncate the text.

                    &extenders - let’s you choose the summary extender to be able to give the "teaser"
                    &trunc - turns on the truncation
                    &truncLen - length, in characters, you want to show as a "teaser"
                    &truncOffset - ditto will search x number of characters to end the post (to find a period or end of a word)
                    &truncText - You can specify here what you want the link to the rest of the article to say.

                    Good luck, but make sure you read the ditto documentation too. Ditto is an extremely powerful tool.

                      The MODx has you...
                      Utah Web Design