'Page List' for sets
Permalink
I have a whole bunch of PDF files in a number of different sets. I would like to be able to use a 'Page List' type block to display the Name, description and a link to each file.
Any one have any direction on this?
Thanks.
Any one have any direction on this?
Thanks.
I don't know if you can do this with C5's default blocks, but programatically you do this by:
<?php $fs = FileSet::getByName('Fileset Name Here'); $fsl = new FileList(); $fsl->filterBySet($fs); $fsl->filterByExtension('pdf'); $arrFiles = $fsl->get(); foreach($arrFiles as $objFile){ if(!is_object($objFile) || !$objFile instanceof File || $objFile->error) continue; $fv = $objFile->getVersion(); echo $fv->getRelativePath() . ' -- ' . $fv->getTitle() . ' -- ' . $fv->getDescription(); } ?>
Thanks,
Maria