devp-eu / tmcms-module-gallery
Module Gallery for TMCms
dev-master
2018-09-02 18:36 UTC
Requires
- devp-eu/tmcms-core: dev-master
- devp-eu/tmcms-module-images: dev-master
- devp-eu/tmcms-panel: dev-master
This package is not auto-updated.
Last update: 2025-03-03 01:44:27 UTC
README
Module Gallery for TMCms
Module adds image gallery functionality as separate module AND as possibility to auto-create internal galleries for every Entity presented in any other module, e.g. Products, Articles, etc.
Usage for Entities
Create Gallery column
// Data for table ... $product = new ProductEntity(); $entity_class = strtolower(Converter::classWithNamespaceToUnqualifiedShort($product)); $images = new ImageEntityRepository(); $images->setWhereItemType($entity_class); ... // Table Helper ... 'columns' => [ ..., 'gallery' => [ 'type' => 'gallery', 'images' => $images, ], ..., ], ...
And add method for managing gallery images in CmsClass
... public function images() { $product_id = ... // whatever you need $product = new ProductEntity($product_id); echo ModuleGallery::getViewForCmsModules(product); }