-
- 143 Posts
Hello,
I am trying to get content from one page to post fully on a parent page based on publish date. These are devotionals that I create under a parent, but I would like to have the parent to have the current devotional to be posted on the parent. Just need help to where to get started. I have tried playing with getresources and have yet to get it working.
I am using Revolution 2.4.1 With Flexibility 4.
Thanks
[[getResources? &parents=`[[*id]]` &includeContent=`1` &limit=`1` &tpl=`resourceTpl`]]
The resourceTpl chunk:
Adjust the HTML structure of the tpl chunk as necessary to fit in with your theme, the important part is the content placeholder.
By default getResources sorts by date, so when fetching only one it will be the latest one.
-
- 143 Posts
Hello Susan,
Thanks for your response.
It worked, which you probably know..lol
But I need to get it to sort so that the newest posted child will be displayed, so that every time I add a new post either by adding an article or by a publish date. I tried different sort, but I am not able to get it to work. Matter of fact when I add it is stops showing anything. Example below.
[[getResources? &parents=`55` &includeContent=`1` &limit=`1` &tpl=`resourceTpl` &sortby=`id` &sortdir=`ASC`]]
Tried this also, &sortby=`{"publishedon":"ASC","createdon":"DESC"}` and variations of it
Thanks for the help!
The default sort order should be good, it is publishedon in the latest versions.
[[getResources?
&parents=`55`
&includeContent=`1`
&limit=`1`
&tpl=`resourceTpl`
]]
-
- 24,544 Posts
If you do need to set the sort, try this:
&sortby=`{"publishedon":"DESC"`}
You can also add a subsidiary sort method. This will sort by publish date, then by pagetitle:
&sortby=`{"publishedon":"DESC"`,"pagetitle":"ASC"}
[ed. note: BobRay last edited this post 8 years, 1 month ago.]
-
- 24,544 Posts
Sorry, it should be:
&sortby=`{"publishedon":"DESC","pagetitle":"ASC"}`
[ed. note: BobRay last edited this post 8 years, 1 month ago.]
If all you want to do is display the latest item, there's no need for anything fancy.