.. include:: /Includes.rst.txt .. highlight:: php ============= PSR-14 Events ============= .. versionadded:: 11.0.0 You can register your own PSR-14 Event Listener and extend the functionality of the TYPO3 Crawler. In this section you will see which events that you can listen too. **Events within the Crawler** .. contents:: :depth: 1 :local: .. _psr14-modify-skip-page-event: ModifySkipPageEvent =================== With this event, you can implement your own logic whether a page should be skipped or not, this can be basically a skip by uid, like in the example below. It can also be a more complex logic that determines if it should be skipped or not. Let's say you don't want to crawl pages with SEO priority 0.2 or lower. This would then be the place to add your own listener to Modify the Skip Page logic already implemented. .. rst-class:: bignums-xxl #. Create the event listener :: getPageRow()['uid'] === 42) { $modifySkipPageEvent->setSkipped('Page with uid "42" is excluded by ModifySkipPageEvent'); } } } #. Register your event listener in :file:`Configuration/Services.yaml` .. code-block:: yaml services: AOE\Crawler\EventListener\ModifySkipPageEventListener: tags: - name: event.listener identifier: 'ext-extension-key/ModifySkipPageEventListener' event: AOE\Crawler\Event\ModifySkipPageEvent .. _psr14-after-url-crawled-event: AfterUrlCrawledEvent ==================== This events enables you to trigger, e.g a Vanish Ban for a specific URL after it's freshly crawled. This ensures that your varnish cache will be up to date as well. .. rst-class:: bignums-xxl #. Create the event listener :: $afterUrl()); } } #. Register your event listener in :file:`Configuration/Services.yaml` .. code-block:: yaml services: AOE\Crawler\EventListener\AfterUrlCrawledEventListener: tags: - name: event.listener identifier: 'ext-extension-key/AfterUrlCrawledEventListener' event: AOE\Crawler\Event\AfterUrlCrawledEvent .. _psr14-invoke-queue-change-event: InvokeQueueChangeEvent ====================== The InvokeQueueChangeEvent enables you to act on queue changes, it can be e.g. automatically adding new processes. The event takes a `Reason` as arguments which gives you more information about what has happened and for GUI also by whom. .. rst-class:: bignums-xxl #. Create the event listener :: getReason() // You can implement different logic based on reason, GUI or CLI } } #. Register your event listener in :file:`Configuration/Services.yaml` .. code-block:: yaml services: AOE\Crawler\EventListener\InvokeQueueChangeEvent: tags: - name: event.listener identifier: 'ext-extension-key/InvokeQueueChangeEventListener' event: AOE\Crawler\Event\InvokeQueueChangeEvent .. _psr14-after-url-added-to-queue-event: AfterUrlAddedToQueueEvent ========================= AfterUrlAddedToQueueEvent gives you the opportunity to trigger desired actions based on e.g. which fields are changed. You have `uid` and `fieldArray` present for evaluation. .. rst-class:: bignums-xxl #. Create the event listener ::