Skip to content

Commit

Permalink
snippet.galleryalbums: add id parameter
Browse files Browse the repository at this point in the history
if set, shows only the album with the given id
  • Loading branch information
cherbst committed Nov 10, 2011
1 parent e1a2006 commit 6e42508
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -39,6 +39,7 @@
$start = $modx->getOption('start',$scriptProperties,0);
$parent = $modx->getOption('parent',$scriptProperties,0);
$showAll = $modx->getOption('showAll',$scriptProperties,false);
$id = $modx->getOption('id',$scriptProperties,false);
$albumRequestVar = $modx->getOption('albumRequestVar',$scriptProperties,'galAlbum');
$albumCoverSort = $modx->getOption('albumCoverSort',$scriptProperties,'rank');
$albumCoverSortDir = $modx->getOption('albumCoverSortDir',$scriptProperties,'ASC');
Expand Down Expand Up @@ -78,6 +79,11 @@
}
$c->sortby($sort,$dir);
if ($limit > 0) { $c->limit($limit,$start); }
if (!empty($id)) {
$c->where(array(
'id' => $id,
));
}
$albums = $modx->getCollection('galAlbum',$c);

/* get thumb properties for album cover */
Expand Down Expand Up @@ -124,4 +130,4 @@
$modx->setPlaceholder($toPlaceholder,$output);
return '';
}
return $output;
return $output;

0 comments on commit 6e42508

Please sign in to comment.