-
☆ A M B ☆
- 872 Posts
I’ve heard good thing about getRessources, so i just wanted to test it.
Ditto will be coming after (sooner now)
@splittingred
Weird. All the other snippets seems to work but getResources.
I’ll try to play further with it on another machine and see if the probleme repeat itself.
@lossendae - getReources is working for me and I have upgraded via SVN to MODx Revolution 2.0.0-beta-2 from beta 1. Check you call.
Centos 5.3 w/ PHP 5.2.6 (alternative repo)
-
☆ A M B ☆
- 872 Posts
Didn’t do anything special, just upgraded and tried it again.
Quote from: netdoctor at Jul 04, 2009, 10:32 PM
First remove the &includeContent=`1` and see if the snippet returns an array. If you don’t get an array then you have an issue with the snippet and you will have to look at your settings.
If an array is returned then create a template chunk like you would with ditto.
[[getResources? &parents=`1` &tpl=`myTpl`]]
Here is an example of a simple chunk
<h2>[[+pagetitle]]</h2>
<p>
[[+introtext]] - <a class="readmore" href="[[~[[+id]]]]" title="[[+pagetitle]]">read more ..</a>
</p></p>
Read the comments in the snippet for more info and look at the return on the array for your placeholders.
Re: the link in the chunk.. Links in Revo are [[~id]] and the placeholder from getResources is [[+id]] so wrap it as shown in the code example above.
The snippet is working for me.
Revo Beta 1
getResources snippet : version 1.0.0-beta
netdoctor - thanks for the sample code - it’s exactly what I was looking for. I couldn’t figure out how to utilize the snippet, but now it’s working great! It looks like this will be a very useful bit of code.
God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.