'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.

chunksmurray
 
Maria replied on at Permalink Reply
I need exactly the same thing! If you have found a solution to this, would you mind sharing?

Thanks,
Maria
beebs93 replied on at Permalink Reply
beebs93
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();   
}
?>