Quote from: panahapi at Oct 01, 2013, 05:05 AMAh, yes.. I just realized it's a "higher" level tools suitable for a casual user.
Yep. There is 6 snippets for now:
pdoResources - fast replacement for getResources
pdoSitemap - fast replacement for GoogleSiteMap
pdoCrumbs - fast replacement for Breadcrumb
pdoField - replacement for getResourceField and UltimateParent
pdoUsers - list users of your site by groups and\or roles
pdoNeighbors - show links to neighbors documents (next, prev and up)
Also you can simple get resources in your snippets like that:
$pdo = $modx->getService('pdoFetch');
if ($resource = $pdo->getObject('modResource', 15)) {
print_r($resource);
}
Or you can retrieve and template a number of resources:
$pdo = $modx->getService('pdoFetch');
$resources = $pdo->getCollection('modResource', array('id' > 0, 'published' => 1), array('limit' => 10, 'includeTVs' => 'myTV1')));
if (empty($tpl)) {$tpl = '@INLINE <p>[[+idx]]. [[+pagetitle]]</p>';}
$output = '';
foreach ($resources as $row) {
$output .= $pdo->getChunk($tpl, $row)
}
return $output;
[ed. note: bezumkin2 last edited this post 10 years, 5 months ago.]