0

I have a structure like this: http://gyazo.com/3deb54c430da3b3bff50c29f6f6e3947 and a code shown below:

[[$std_head]]

[[getResourceField]]

[[!getResources? &showHidden=`1` &parents=`5` &includeContent=`1` &includeTVs=`1` &processTVs=`1` &depth=`1`]]

[[$std_foot]]

As shown in structure, all elements are connected, so must be shown dump of 2nd and 6th elements. So, chunks working, getResourceField working, getResources - not. why can it be?

  • Okay...i ran all this at local and watched all MySQL queries...it found elements. But I still cant see the result( – Void_Fire_Wind Jan 23 '14 at 10:49
  • What happens if you call it like this: [[!getResources? &parents=`5`]]? You have cleared the modx cache? – Sean Kimball Jan 23 '14 at 21:21
  • Cleared cache on updating page template...deleted cache folder...made call that @SeanKimball wrote....nothing changes. – Void_Fire_Wind Jan 24 '14 at 08:01
  • run [[getResources]] only on a new empty template. if you don't get an array of resources getResources might not work for you. Checkout any error logs related to getResources in the console log as well as the server logs. also try creating your own snippet and run it. Use this var_dump($modx->getChildIds(0)); – orbitory Jan 27 '14 at 21:27
  • on clear and empty template...result is still clean and empty without chunk. – Void_Fire_Wind Jan 28 '14 at 10:53

4 Answers4

0

The call seems valid. Are you sure you have getResources installed properly?

goldsky
  • 801
  • 7
  • 11
  • how can i check it? modx writes all is ok...but getresource never shows nor info besides of `[[!getResources:default=`No results found`? &...` - it shows no results found – Void_Fire_Wind Jan 23 '14 at 05:05
  • How can you check it? *System > Package Management*. Check whether getResources is on the list or not. – goldsky Jan 24 '14 at 15:02
  • Uninstall it, then install it back. No problem with your snippet's call, the problem is in the installation or your server. – goldsky Jan 26 '14 at 03:48
  • reinstalled...3 times. not working. MAy be, problem is for example in php.ini of server? (two servers, local and hosted) I searched but didnt find parameters dicription of modx and getresource – Void_Fire_Wind Jan 26 '14 at 08:54
0

are you seeing the content for [[$std_foot]] - if not there is probably an error. getResourceField should have parameters. test your template without it. Also - getResourcers should just dump an array of resources if you don't include the template parameter. as goldsky says the call looks good, I think something else is causing the error.

Sean Kimball
  • 4,506
  • 9
  • 42
  • 73
0

GetResources needs a template or placeholder to output to.

jivers
  • 910
  • 2
  • 9
  • 16
  • so, what I need to do? I thought that even by call of getResource in template it must show dump to show that it works – Void_Fire_Wind Jan 23 '14 at 17:21
  • Step one, read the getResources documentation, which will show you all required parameters. http://rtfm.modx.com/extras/revo/getresources. Than, add the &tpl parameter after you create the template for whatever it is you have getResources showing. – jivers Jan 23 '14 at 21:16
  • You do not need the &tpl, if you omit it getResources will dump the raw results as an array. – Sean Kimball Jan 23 '14 at 21:19
  • Yes, I read documentation and it says that without template i will see just dump. I'll try to use template, may be dumps are not available now? – Void_Fire_Wind Jan 24 '14 at 07:57
  • My bad -- was not aware of this. – jivers Feb 06 '14 at 20:26
0

With template chunk all working! (for example &tpl=tplll) Dump isn't shown nor on my local server, nor on hosting, nor on local server of my australian friend who have very different version of all environment. With chunk all works on all system. I think, problem solved. GetResource don's show dump now, but it isn't written in manual.