📜 ⬆️ ⬇️

Ditto Modx for Dummies News, Articles

I myself am a teapot and have not found a single intelligible article on this topic on the whole Internet, where everything is explained step by step and as a result it works. After a long time, I made up for myself and others as clear guidance.

1. Create a new resource, call it “News”, go to the Page Settings tab and uncheck “Cached” (this is necessary for the page switch to work)

2. All child documents of this resource will be our news. In the Title field, enter the news headline, enter the abbreviated news in the Summary field, and enter the full text of the news in the largest window. Be sure to include a tick on Publish. To create a child document, right-click on the document "News" and select "Child Doc."

3. Create a chunk, for example ”tpl_news” which will contain the html-output template of the article.
image
')
Here is more about all placeholders

4. In order to create a page for displaying all the news in the largest window of the News resource (or create a new resource and execute step 1), call the Ditto CASH
& summarize = `5` - set the number of news per page
& paginate = 1 - enable paging mode, thereby disable the archive
& tpl = `tpl_news` - ​​refer to the article output template we created earlier.

[[Ditto? &startID=`11, 15` &summarize=`10` &tpl=`tpl_news` &paginate=`1`]]

.: [+pages+]

Ditto options

5. To create a block of several news on the main page, in the right place call Ditto
[[Ditto? startID=`11, 15` summarize=`2` tpl=`tpl_news`]]

Source: https://habr.com/ru/post/92057/


All Articles