Events 

The bm_image_gallery extension dispatches events that allow you to hook into the gallery rendering process at strategic points. These events follow TYPO3's PSR-14 event system and can be used to:

  • Modify collection data
  • Filter or enrich items
  • Add template variables
  • Implement custom business logic

Event Overview 

Event When Dispatched Main Purpose
AfterCollectionInfoResolvedEvent After complete processing Enrich collection info array
AfterItemsSortedEvent After sort + limit Post-process sorted items
BeforeRenderingEvent Before view assignment Add template variables

AfterCollectionInfoResolvedEvent 

Class: Freshworkx\BmImageGallery\Event\AfterCollectionInfoResolvedEvent

When is it dispatched?

  • After all extension processing
  • After description/preview fallbacks
  • After items have been sorted (if requested)

AfterItemsSortedEvent 

Class: Freshworkx\BmImageGallery\Event\AfterItemsSortedEvent

When is it dispatched?

  • After FileCollector->sort()
  • After maxItems limit

BeforeRenderingEvent 

Class: Freshworkx\BmImageGallery\Event\BeforeRenderingEvent

When is it dispatched?

  • Dispatched in all actions (list, gallery, detail)
  • Before $this->view->assign() or assignMultiple()

Event Registration 

Method 2: Services.yaml 

services:
  MyVendor\MyExtension\EventListener\MyListener:
    tags:
      - name: event.listener
        identifier: 'my-ext/my-listener'
        event: Freshworkx\BmImageGallery\Event\AfterCollectionInfoResolvedEvent
Copied!

Further Resources