[TYPO3-dev] How to create pages/elements via Extension/Hook?

Bernhard Kraft kraftb at think-open.at
Sun Aug 26 13:19:07 CEST 2018


Hi,

On 08/24/2018 09:34 AM, Stefan Franke wrote:

> I need to create pages/elements on the fly when saving a page record in the backend. Right now, I'm using the following code with the hook `processDatamap_preProcessFieldArray`:

As you are already utilizing a hook in DataHandler I would suggest to 
rather use the "afterDatabaseOperation" hook therein and then make a 
recursive call to itself "$this->process_datamap()" to create the new 
entry, eventually from an template record/dataset.

As you are creating pages after a page has been created you would have 
to take care to avoid infinite loops by using some static variable 
keeping the hook from being executed a second time.


cu,
Bernhard



More information about the TYPO3-dev mailing list