TYPO3: Hook after creating or editing page

前端 未结 3 1166
广开言路
广开言路 2020-12-03 01:57

I\'m searching for a hook which is called after page creation or changes on pages like \"hide page in nav\", \"deactivate page\" or \"move/de

3条回答
  •  清歌不尽
    2020-12-03 02:36

    These Hooks are located in t3lib/class.t3lib_tcemain.php

    The following are just some of those:

    • processDatamap_preProcessFieldArray
    • processDatamap_postProcessFieldArray
    • hook_processDatamap_afterDatabaseOperations
    • processDatamap_afterAllOperations

    In your case, i think you could use "processDatamap_postProcessFieldArray".

    Example how to include it in your ext_localconf.php:

    $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = 'EXT:your_extension/hooks/class.tx_yourextension_tcemain.php:tx_yourextension_tcemain';
    

    Example class:

    
    

    With $table, you can check which table is modified. $status allows you to retrieve the current action, for example "new", "update" or "delete".

    Example for TYPO3 > 6 with namespaces on another hook:

    $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/tslib/class.tslib_menu.php']['filterMenuPages']['YourExtension\\Hook\\FilterMenuPages'] = 'EXT:your_extension/Classes/Hook/FilterMenuPages.php:YourExtension\Hook\FilterMenuPages';
    

提交回复
热议问题