We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24904
    • 79 Posts
    I been trying to search for help how I could create a news page?

    Example
    I have
    -News Main (parent document)
    -news 1 (child document)
    -news 2 (child document)
    etc...

    how would I show all the new on the "News Main" page?
    do I use ditto? do I use news publisher?

      • 25663 MODX Staff
      • 12,272 Posts
      Ditto
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 24904
        • 79 Posts
        thanks
        I read this http://ditto.modxcms.com/
        although couldn’t figure out how I would create a news page with ditto?

        examples?
          • 25663 MODX Staff
          • 12,272 Posts
          Install the demo content on a local development server and learn by example. smiley
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 3749
            • 24,544 Posts
            Just to get you started . . .

            The usual way of doing this is to have each news story be a separate MODx document -- created in the MODx Manager or in the front-end with the NewsPublisher snippet.

            You can organize the tree of stories however you want either by right-clicking on a parent and selecting "create document here" to make a child document or by just creating the document and then setting its parent in the document create/edit screen.

            A Ditto call on the main news page with the ID of the top-level parent then pulls pieces of the documents/news stories (title, longtitle, summary, author, date, etc. -- depending on the layout of the Ditto tpl file) and displays them on your main news page with links to the full stories. I’d suggest you leave the tpl part ’til last and just use the Ditto default tpl until you get the selection you want, then adjust the tpl as necessary.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 24904
              • 79 Posts
              Quote from: BobRay at Oct 02, 2008, 12:15 AM

              Just to get you started . . .

              The usual way of doing this is to have each news story be a separate MODx document -- created in the MODx Manager or in the front-end with the NewsPublisher snippet.

              You can organize the tree of stories however you want either by right-clicking on a parent and selecting "create document here" to make a child document or by just creating the document and then setting its parent in the document create/edit screen.

              A Ditto call on the main news page with the ID of the top-level parent then pulls pieces of the documents/news stories (title, longtitle, summary, author, date, etc. -- depending on the layout of the Ditto tpl file) and displays them on your main news page with links to the full stories. I’d suggest you leave the tpl part ’til last and just use the Ditto default tpl until you get the selection you want, then adjust the tpl as necessary.

              thanks it works!!!

              However, how does ditto know where to get the intro text??

              I followed this
              http://ditto.modxcms.com/tutorials/creating-a-custom-template.html

              It now shows
              "Mynews Title Goes here
              by Default admin account on 03-Oct-08 16:33"
                • 3749
                • 24,544 Posts
                Quote from: Revolver at Oct 03, 2008, 01:51 AM


                thanks it works!!!

                However, how does ditto know where to get the intro text??

                I haven’t used it in a while, but I believe that’s MODx’s internal name for the "Summary" field, so it comes from whatever’s in that field of the document create/edit screen.

                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Yes, the Summary field is actually saved to the "introtext" field in the database. It’s an artifact of the original parent application’s code.

                  I got so frustrated at never being able to remember what it was called, and having to go look in the database every time I wanted to use it in code, that I threw a tantrum and insisted that the extra text "(introtext)" be added to the field’s label. It was far too late to change the name in the database; too many other scripts used it.

                  There are a few oddities in the database, like "emailsender" when all of the other configuration fields use underscores like "site_name"; and "htmlsnippets" are what chunks used to be called before they ended up being called "chunks". Show in Menu actually gets reversed; the field in the database is "hidemenu", so checking the box in the form sets a 0 in the database, the opposite of what you might expect, and caused no end of trouble when QuickEdit didn’t work that way!
                    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
                    • 24904
                    • 79 Posts
                    Makes sense,
                    thanks guys

                    works now smiley