Skip to content

Instantly share code, notes, and snippets.

@pavel-one
Last active September 16, 2019 11:55
Show Gist options
  • Save pavel-one/72f99a7bf6a4ad23519f44b3c59d5609 to your computer and use it in GitHub Desktop.
Save pavel-one/72f99a7bf6a4ad23519f44b3c59d5609 to your computer and use it in GitHub Desktop.
UserFiles select one thumbinails
{'!pdoResources' | snippet: [
'parents' => $_modx->resource.id,
'limit' => 0,
'tvPrefix' => '',
'tpl' => '',
'leftJoin' => [
'UF' => [
'class' => 'UserFile',
'on' => 'UF.parent = modResource.id AND UF.rank = 0'
]
],
'select' => [
'modResource' => '*',
'UF' => 'url as thumb'
],
'showLog' => 1,
'where' => [
],
'sortdir' => 'ASC'
]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment