How to fetch articles on custom page in MODX CMS

192 Views Asked by At

I am new to the MODX CMS so I don't know more about this CMS. I tried to fetch articles in the custom template please see screenshot 01:-

Screenshot 01 enter image description here

This is the shortcode of articles which I am using to fetch the articles on the custom pages please see screenshot 02:-

Screenshot 02 enter image description here

This is the article template and this is working fine with the shortcode Please see the Screenshot 03:-

Screenshot 03 enter image description here

I Researched on the google so I found this

[[getResources]]

but I don't know how to use it.

1

There are 1 best solutions below

0
On

First of all check this reference: https://docs.modx.com/current/en/extras/getresources/index But as for me it'll be much better to use pdoResources(has useful option &showLog for your needs) from pdoTools extra: https://docs.modx.pro/en/components/pdotools/snippets/pdoresources For test purposes please call uncached (with ! sign before name) snippets f.e

[[!getResources]], [[!pdoResources]]

Also be aware these snippets don't show hidden and unpublished resources by default, you should point this directly: f.e.

[[pdoResources?&showUnpublished=`1`]] 

[[getResources?&showUnpublished=`1`&showHidden=`1`]]