Questions re old Slideshow block
Permalink
I'm running a website on Concrete5 5.6.3.5. On the homepage there is a Slideshow block, showing images from a Fileset. I have hacked the code in this block a few times, to get it to look/behave as I want it, and that's all fine. But during the last mods I made, I realised that I don't understand something about how the block mechanism works.
In this block, everything happens in the view.php file. It essentially outputs a lot of javascript, including an array containing information about the images. The javascript does the actual work of displaying the images. There are 2 things I don't get:
1. The controller.php file is essentially empty - all it does is define an empty class which extends a class called Concrete5_Controller_Block_Slideshow. But I can't see where the class Concrete5_Controller_Block_Slideshow is defined - it is certainly not in any of the files belonging to the Slideshow block. So, where is class Concrete5_Controller_Block_Slideshow defined?
2. In view.php, the PHP code generates an array of javascript objects, from the data it has read from the database for this specific slideshow. The data from the database ends up in a PHP variable called $images. BUT - I can see nowhere in any of the code for the block where it reads this data from the database.
I have attached the code for view.php. In the PHP code where it iterates through the image data (line 81), the code is:
foreach($images as $imgInfo) {
This is the only place where I can see the variable called $images being used. So how/where does the data get put into it?
This is not stopping me from doing anything, but I just like to know how things work.
In this block, everything happens in the view.php file. It essentially outputs a lot of javascript, including an array containing information about the images. The javascript does the actual work of displaying the images. There are 2 things I don't get:
1. The controller.php file is essentially empty - all it does is define an empty class which extends a class called Concrete5_Controller_Block_Slideshow. But I can't see where the class Concrete5_Controller_Block_Slideshow is defined - it is certainly not in any of the files belonging to the Slideshow block. So, where is class Concrete5_Controller_Block_Slideshow defined?
2. In view.php, the PHP code generates an array of javascript objects, from the data it has read from the database for this specific slideshow. The data from the database ends up in a PHP variable called $images. BUT - I can see nowhere in any of the code for the block where it reads this data from the database.
I have attached the code for view.php. In the PHP code where it iterates through the image data (line 81), the code is:
foreach($images as $imgInfo) {
This is the only place where I can see the variable called $images being used. So how/where does the data get put into it?
This is not stopping me from doing anything, but I just like to know how things work.
I was thrown by the fact that files for the slideshow block now seem to be in two different places - not what I expected. Matter closed.