[TYPO3-english] Add action before text field save/publish

Lorenz Ulrich lorenz-typo3 at visol.ch
Thu Sep 19 00:10:29 CEST 2013


Hi Benjamin

Updating Data in TYPO3 is done through TCEmain (4.x)/DataHandler (6.x). 
There are hooks in TCEmain, you could e.g. use the 
processDatamap_afterDatabaseOperations hook you find there:
<https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/core/Classes/DataHandling/DataHandler.php>

Still I doubt that your approach is very wise. Everytime someone changes 
content, that would trigger posting your news to Social Media. If 
someone makes a typo and corrects it, this would also trigger a posting. 
Of course you could also do it only for new records, but still then you 
don't have control and can't allow to add content for testing purposes.

I have two ideas:
- Either add a field to tt_content the user has to check, e.g. "post to 
facebook". Only if this is checked, the hook publishes your data.
- Or create a Scheduler task/Extbase CommandController that looks up for 
new content element and publishes them to Social Media if it has reached 
a certain age (e.g. 10 minutes after the crdate) and let the task post it.

Best regards,

Lorenz

Am 18.09.2013 18:26, schrieb Benjamin Gaunitz:
> Hi there,
>
> I want to add an action before the content of a text field is
> save/published on the webpage, as I want to publish the data to Social
> Media simultaneously. That works fine already, if I use my own HTML form
> without any framework, but I am looking since one month to do that in
> TYPO 3. Haven't found a useable hook either.
>
> I would really appreciate, if someone could help me or give me some
> hints :)
>
> Thanks very much in advance,
> Ben



More information about the TYPO3-english mailing list