Calling the block using phpBrowser Info Environment
if you're wanting to change the way the block outputs the file names, what you need to do is override the block's template, or create a custom block template for it (so you can pick when you use it).
You would need to:
- Create in the top level /application/blocks folder, a folder called list_files_from_set.
- In that, copy in the view.php from the list files from set package and them make changes to that version, which will override what it outputs.
Alternatively, you can create the folder /application/blocks/list_files_from_set/templates and in that copy in the view.php, but rename it to something else. Then you can pick what you've copied in as a custom template when you are editing a block, see -http://www.concrete5.org/documentation/using-concrete5-7/in-page-ed...
If you haven't overridden blocks before, you may need to look up a general guide on how to do that.
$blockType = BlockType::getByHandle('list_files_from_set'); //parameters passed here $blockType->render('view');
Sorry if it wasn't clear.
What you have should work, you can adjust settings by adding in before your render line, things like:
$blockType->controller->fileOrder = 'set_order';
For the different things you _might_ be able to adjust, have a look at the db.xml and at the database fields the block uses.
You might also want to look at this blog post as well, it might give you a good example of what to do -http://www.mesuva.com.au/blog/concrete5/creating-a-composer-driven-...
This kind of approach works in 5.6, but I haven't hard coded the block in 5.7 yet. Hopefully the same code still works.
Loader::model('file_set'); //get the file set object as $fs $blockType = BlockType::getByHandle('list_files_from_set'); $blockType->controller->fsID = $fs->getFileSetID(); // set the file set ID to the ID of the file set object $fs $blockType->controller->numberFiles=10; //set the number of files to display $blockType->controller->paginate='true'; $blockType->render('view');
Many thanks for your help and for such a useful addin.