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/delete page
"
Does someone know of one?
Thanks!
The ' Browser title ' ( title-TAG) will show as a link in the search engine result and also in the browser tab (1). If this field is left empty, TYPO3 will use the page title.
If this field is left empty, TYPO3 will use the page title. As a standard the TYPO3 will be set to add the company name in the 'Browser title' automatically, but by checking the box ' Title only ' (2), it will only show the information from the 'Browser title' field.
To edit them, you can either right click on the page title, in the page tree, and choose "Edit" (Img. 1.2.1) or you can click the page properties icon above the page content area (Img. 1.2.2). This section will focus on page properties for a Standard page. Read more about other page type properties here.
The page settings contains information about metadata, page layout and also has visibility settings. To edit them, you can either right click on the page title, in the page tree, and choose "Edit" (Img. 1.2.1) or you can click the page properties icon above the page content area (Img. 1.2.2).
These Hooks are located in t3lib/class.t3lib_tcemain.php
The following are just some of those:
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:
<?php
class tx_yourextension_tcemain {
function processDatamap_postProcessFieldArray($status, $table, $id, &$fieldArray, &$pObj) {
if($table == 'pages' && $status =='new') {
// do some stuff
}
}
}
?>
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';
For TYPO3 7.6 version (Also Works in 10.4.X as well)
Write following in ext_localconf.php
$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['extkey'] = 'Vendor\\Extension\\Hook\\TCEmainHook';
$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['extkey'] = 'Vendor\\Extension\\Hook\\TCEmainHook';
Create hook class /Classes/Hook/TCEmainHook.php, Choose appropriate function from below list
<?php
namespace Vendor\Extension\Hook;
class TCEmainHook {
public function processCmdmap_preProcess($command, $table, $id, $value, \TYPO3\CMS\Core\DataHandling\DataHandler &$pObj) {}
public function processCmdmap_postProcess($command, $table, $id, $value, \TYPO3\CMS\Core\DataHandling\DataHandler &$pObj) {}
public function processDatamap_preProcessFieldArray(array &$fieldArray, $table, $id, \TYPO3\CMS\Core\DataHandling\DataHandler &$pObj) {}
public function processCmdmap_deleteAction($table, $id, $recordToDelete, $recordWasDeleted=NULL, \TYPO3\CMS\Core\DataHandling\DataHandler &$pObj) {}
public function processDatamap_afterAllOperations(\TYPO3\CMS\Core\DataHandling\DataHandler &$pObj) {}
public function processDatamap_postProcessFieldArray($status, $table, $id, array &$fieldArray, \TYPO3\CMS\Core\DataHandling\DataHandler &$pObj) {}
public function processDatamap_afterDatabaseOperations($status, $table, $id, array $fieldArray, \TYPO3\CMS\Core\DataHandling\DataHandler &$pObj) {}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With