Order images according to file set order
Permalink Browser Info Environment
Just in case someone else faces this issue: To have the images ordered according to the order in the file set, I copied the block controller and added one line to the function 'loadFileSet()':
function loadFileSet(){ //... $fs = FileSet::getByID($this->fsID); $fileList = new FileList(); $fileList->filterBySet($fs); $fileList->filterByType(FileType::T_IMAGE); $fileList->sortByFileSetDisplayOrder(); // <-- new $files = $fileList->get(1000,0);
Type: | Discussion |
---|---|
Status: | In Progress |
thanks! exactly what I was looking for!
Hi
Was this the one located in the libraries directory. I'm using the latest version (5.4.2) and can't seem to find that code anywhere?
Any suggestions?
Thx
Was this the one located in the libraries directory. I'm using the latest version (5.4.2) and can't seem to find that code anywhere?
Any suggestions?
Thx
That controller file is located in /packages/asmiller_gallery/blocks/asmiller_gallery and these lines are around 76–80.
You're a life saver, thanks.
Now If I could find a way to call specific images to display when using a query string.
Now If I could find a way to call specific images to display when using a query string.
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.
To re-open this issue, reply to this message.
To re-open this issue, reply to this message.
Thanks for this - just what I needed. Allowed me to create this snippet that might be useful for someone. Creates a custom gallery from a file set, defined by a custom page attribute called 'gallery_fileset'.
$gallerySet = $c->getAttribute('gallery_fileset'); Loader::model("file_set"); Loader::model('file_list'); $fs = FileSet::getByID($gallerySet); $fl = new FileList(); $fl->filterBySet($fs); $fl->sortByFileSetDisplayOrder(); $files = $fl->get(); foreach($files as $f) { echo '<img src="'.$f->getDownloadURL().'" alt="'.$f->getTitle().'">'; }