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?
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.
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.
-
☆ 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!