How to display thumbnail in list view

aijosh

Member
Hello,
How does the fileupload decide on which version of the image to display?

I have a list where it displays the thumbnail but also another list where it displays the cropped version.

I need it to also display the thumbnail in the second list
 
That's done deep in the image model ...

https://github.com/Fabrik/fabrik/blob/master/plugins/fabrik_element/fileupload/models/image.php#L112

... but there is a way of overriding that. Each file type as a wrapper in the /elements folder, like ...

https://github.com/Fabrik/fabrik/blob/master/plugins/fabrik_element/fileupload/element/png.php

... which for PNG's loads the image.php renderer referenced above. But first, we look to see if there's an ovverride for png.php in fileupload/element/custom/png.php ...

https://github.com/Fabrik/fabrik/tree/master/plugins/fabrik_element/fileupload/element/custom

So you could copy the main element/png.php to element/custom/png.php, and instantiate a different image model to handle it. Which would involve copying ...

https://github.com/Fabrik/fabrik/blob/master/plugins/fabrik_element/fileupload/models/image.php

... to something like ...

https://github.com/Fabrik/fabrik/blob/master/plugins/fabrik_element/fileupload/models/myImage.php

... and tweaking the lines I reference above (around 112) so it ignores the cropped image and always renders the thumb, and load your copy of that file in your custom PNG wrapper. Then you'd need to do the same thing for any other image file types you need to handle, with a custom wrapper than loads your copy of myImage.php.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top