Hello,
I would like to list a list of child pages with title and a small amount of content. Can someone provide me with where I can start on how to do this?
Thanks
-
☆ A M B ☆
- 1,780 Posts
MOdx Revo 2.5.1-pl
Working on displaying multiple child resources on a container page. I have gotten this to work before, but I am not able to get it to work on this site. id:16 is the parent, then I have several child pages under it. So what I am looking to build is to have the title, and some of the content displayed with a more link. Probably will need some sort of paging.
[[getResources?
&parents=`16`
&includeContent=`1`
&limit=`1`
&tpl=`resourceTpl`
]]
resourceTpl has [[+content]]
there are no errors. I have this site hosted with Known Host
need help
your resources are published?
maybe your resources are hidden from menu.
Then you will need
and getResources is installed and working?
I finally got it working. I am not sure what I did as I was getting to the place of grasping at straws. I uninstalled the snippet and reinstalled it.
This is the page info:
[[!getResources?
&tpl=`resourceTpl`
&showHidden=`1`
&limit=`10`
&parents=`16`
&sortby=`{"publishedon":"DESC"}`
&includeContent=`1`
]]
this si the tpl:
<h3>[[+pagetitle]]</h3>
<p>[[+introtext]]</p>
[[+content]]
it is unformated, but it works.
When I added the showhidden and the includecontent it started working.
-
☆ A M B ☆
- 1,780 Posts
Quote from: wholein1 at Sep 05, 2016, 11:45 AMI finally got it working. I am not sure what I did as I was getting to the place of grasping at straws. I uninstalled the snippet and reinstalled it.
This is the page info:
[[!getResources?
&tpl=`resourceTpl`
&showHidden=`1`
&limit=`10`
&parents=`16`
&sortby=`{"publishedon":"DESC"}`
&includeContent=`1`
]]
this si the tpl:
<h3>[[+pagetitle]]</h3>
<p>[[+introtext]]</p>
[[+content]]
it is unformated, but it works.
When I added the showhidden and the includecontent it started working.
That's how it works. Your resources are hidden from menus apparently. You'll have to take notice of that for future uses. Main menus often don't show all resources. To use the same snippet across the site you'll have to include &showHidden in all your menus.
The alternate is to have resources set to show in menus and exclude them as needed. It depends on the site and how it's implemented and who it's edited by. If your client can remember to exclude documents, you can use ClientConfig
https://www.modmore.com/extras/clientconfig/ to provide a placeholder to add new resource IDs as needed.