<![CDATA[ Need help with getresource - My Forums]]> https://forums.modx.com/thread/?thread=104835 <![CDATA[Need help with getresource]]> https://forums.modx.com/thread/104835/need-help-with-getresource#dis-post-563721 I have a website with photos. If I click one, you get to a subpage where you can see the photo in larger view with text and more information. Under the photo I would like to show all photos from the parents page. I tried the following call, which does not work.

[[! GetResources?
&parents `[[* id]]`
& Tpl = `myfotosmini`
& Show hidden = '1'
& Include content = '1'
& IncludeTVs = `1`
& ProcessTVs = `1`
& Sortby = `menuindex`
& Sortby = `publishedon`
& Sortdir = `ASC`]]

If I enter the parent resource directly instead of [[* id]], the call works. I would like to automate it because I want to use the template for several different subpages of the same website.

Can someone help me?

Best regards,
Michael]]>
mibolu Jan 23, 2019, 08:06 AM https://forums.modx.com/thread/104835/need-help-with-getresource#dis-post-563721
<![CDATA[Re: Need help with getresource]]> https://forums.modx.com/thread/104835/need-help-with-getresource#dis-post-563735 Quote from: nuan88 at Jan 23, 2019, 03:58 PM
Try `[[*parent]]` instead of `[[* id]]`

Good Morning all,

thank you for your help.

This proposal works for me. I am a beginner with getresource.

Best regards,
Michael]]>
mibolu Jan 24, 2019, 07:42 AM https://forums.modx.com/thread/104835/need-help-with-getresource#dis-post-563735
<![CDATA[Re: Need help with getresource]]> https://forums.modx.com/thread/104835/need-help-with-getresource#dis-post-563733 https://docs.modx.com/extras/revo/getresources#getResources-AvailableProperties]]> BobRay Jan 23, 2019, 11:03 PM https://forums.modx.com/thread/104835/need-help-with-getresource#dis-post-563733 <![CDATA[Re: Need help with getresource]]> https://forums.modx.com/thread/104835/need-help-with-getresource#dis-post-563730
Typos are important especialy apostrophe which is the first key below ESC and before the [1/!] on your keyboard. Others are uppercase, spaces etc. Try this and take a look on differences:

[[getResources? 
&parents=`[[*id]]` 
&tpl=`myfotosmini` 
&showHidden=`1` 
&includeContent=`1` 
&includeTVs=`1` 
&processTVs=`1` 
&sortby=`{"menuindex":"ASC","publishedon":"ASC"}` 
]]


BTW. Including content might be slow in big queries. Sometimes it's better to find other ways. And if you don't have to serve new content on each page refresh use cached snippets (without ! on front).]]>
godzio Jan 23, 2019, 10:03 PM https://forums.modx.com/thread/104835/need-help-with-getresource#dis-post-563730
<![CDATA[Re: Need help with getresource (Best Answer)]]> https://forums.modx.com/thread/104835/need-help-with-getresource#dis-post-563727 nuan88 Jan 23, 2019, 03:58 PM https://forums.modx.com/thread/104835/need-help-with-getresource#dis-post-563727