Navigation
Getting ready
You will need the getresources-1.0.0-ga or later to get started.
How to do it...
1. Install the getResources package through the Package Manager. Upon successful installation, the snippet will appear in your document tree, in the Elements tab under Snippets.
2. Drag the snippet into the textarea of your document. A window will appear with inputs for you to specify the requirements for your call. Pass in a value of 0 to see the names of the placeholders in use.
3. Create template files to wrap the returned data from the snippet. Use the placeholders from step two.
How it works...
The getResources snippet will return relevant data from requested fields. The data is returned in tpl files and can be customized to return a limited number by passing the value as an argument.
Any piece of information from any part of any resource can be returned with a simple query. Dragging the getResources snippet from the tree will show a configurable window intended to help you generate an accurate query. This snippet can be used to generate blogs, RSS feeds, tagging, and many other related functions.
There's more...
The quickest way to generate a snippet call with the correct syntax may be to use the drag-and-drop feature in MODExt, the MODx implementation of ExtJS.
If you’re having trouble getting the data to show on the page, make sure you pass a valid parent id. Try passing ‘0’ to see an array of results returned. The values in the square brackets can be used as placeholders in your template. Example code below.
,