We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9722
    • 11 Posts
    I am going to run a sports website for a team. The news is in folders like, "Fire News" in which all news about the team goes into that folder. How do I on the front page of the website pull that news onto it?

    I am very new and I have done my best to read everything I could, but as I said I am very new to this system and code.

    Any and all help is beyond greatly appreciated....

    Thanks to all that help...
      • 24414
      • 45 Posts
      You will want to have a look at Ditto, see the Ditto documentation @

      http://ditto.modxcms.com/
        • 9722
        • 11 Posts
        ram,

        Ok I have looked at it, but to be honest it is like I am trying to read a foreign language.

        I think I just need some direction as to what might be going wrong. Let me try to get into more detail on what I have been doing:

        Here is the code I used on the front page,
        [[Ditto? &summarize=`4` &total=`3` &startID=`4` &tpl=`news`]]


        That in return gave me this on the front page:
        &tpl either does not contain any placeholders or is an invalid chunk name, code block, or filename. Please check it.


        From my understanding the startID is the folder or document that i want to show, well in my menu on the left hand side I have a Fire News container which holds all of my news articles that I will use for the site. The number I see next to it shows a 4, so I put or I thought from the stuff I have read that is the ID that I need to put in order to pull the news from that area.

        The ;tpl=`news` I thought was the name of the template I was using? I am not sure what to name that part. So far I have three templates, Fire Homepage, Fire News Area and Fire News Articles.

        So what am I missing here? Do I have to put a special code some where in order to pull those articles from that container?

        Again any help is greatly appreciated, I am working on 3 days not being able to get this done and very frustraited in myself for not being able to get it working. I absolutely love this system, I just have to learn how to use it smiley
          • 24414
          • 45 Posts
          It seems you are writing the ampersands in your Ditto call as HTML entities. Remove the amp; part from all of the parameters in the Ditto call.

          [[Ditto? &summarize=`4` &total=`3` &startID=`4` &tpl=`news`]]


          The ;tpl=`news` I thought was the name of the template I was using? I am not sure what to name that part. So far I have three templates, Fire Homepage, Fire News Area and Fire News Articles.

          No the template is a chunk containing the template for your news items.

          You need to create a chunk called news with the HTML code and placeholders you want to be output.

          for instance:
          <div class="article">
          <a href="/[~[*id*]~][+alias+]/" title="Get more information on [+pagetitle+]"><img src="[+photoArticleSmall+]" alt="[+pagetitle+]"></a>
          <h3>[+pagetitle+]</h3>
          <p><a href="/[~[*id*]~][+alias+]/" title="Get more information on [+pagetitle+]">[+introtext+]</a></p>
          </div>
          


            • 9722
            • 11 Posts
            ram,

            Thank you so much for taking the time to explain this!

            I must ask, did I miss that type of code somewhere in the tutorials around here? I am guessing I did because I have not seen anything explaining that I needed stuff like that.

            Again I thank you and like I said I am sure I missed that somewhere...
              • 24414
              • 45 Posts
              That’s no problem at all–

              When I first used Ditto I used the now deprecated documentation at:
              http://modxcms.com/ditto_documentation.html

              This gives a nice broad overview of how to use Ditto, but with Ditto 2 the docs have moved to:
              http://ditto.modxcms.com/

              The reference there is rather heavy-going but there are also some downloadable (HTML) docs found in the first post at:
              http://modxcms.com/forums/index.php/topic,13533.0.html

              In looking around (<5mins) I can’t seem to find a similar quick overview of using Ditto to that in the old deprecated docs. Suppose it’s something for the Wiki if no such docs are about.