[TYPO3-dev] Trouble using hooks
Schani
usenet at schani.com
Sun Jun 15 15:54:51 CEST 2008
Hello Masi,
for example: In a extension like tt_news, create a news article and
instantly also create a sysfolder for more subpages on the pagetree.
I need the Sysfolder(s) for many subpages of a record of my extension.
2nd example. I create a Product in my extension with basic infos like
Produktname, Hersteller, Preis. But now i need more Pages in pagetree
for information to this Produkt. But like to use the flexibility of TV
to design a subpage. Some Producs have only one Subpage. Other Products
have 27 Subpages. For this subpages i also want to use a menue
. No its the best to put this Produkt Subpages in a Sysfolder:
- home
- productlist
|- product database (sysfolder)
- Produkt-subpages (sysfolder)
|- Product1 (sysfolder)
|- technical details
|- configuration
|- support
|- Product2 (sysfolder)
| - configuration
|- ...
The Products are so different that i can not include all infos in one
database. And its also in one database not possible to use TV for the
detail view.
Martin Kutschker schrieb:
> Schani schrieb:
>> Hello all,
>> i have trouble using hooks in my extension.
>> I like to insert a record in the page table from my extension.
>>
>> Now i insert in ext_localconf.php
>>
>> $GLOBALS
>> ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][]
>> = 'EXT:xxx_kunden/class.tx_xxx_kunden.php:tx_xxx_kunden_hook';
>>
>> $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamap_afterDatabaseOperations'][]
>> = 'EXT:xxx_kunden/class.tx_xxx_kunden.php:tx_xxx_kunden_hook';
>>
>>
>> In class.tx_xxx_kunden.php is:
>>
>> <?php
>> class tx_xxx_kunden_hook extends t3lib_DB {
>
> t3libn_db !?!?!
I t3lib_db not the correct Class?
>>
>> Now on save a new record in my xxx_kunden extension, the hooks create
>> not only one page record, but 1400 ?!?
>
> What happens then? Looks like a recursion to me? You invoke a TCE main
> hook ony any DB operation and so any call to your hook triggers another.
>
>> What went wrong? Is it the right way to do this? Why is the hook
>> create many Records?
>
> What do you want to do? It's not clear to me when you want to create the
> extra page record. Whenever an admin adds a certain record? Maybe you
> want to check at least the $table argument in the hook. Otherwise any
> INSERT/UPDATE will result in a new page.
Yes, each new record should create a new sysfolder. Thats what i want.
> Masi
Christian
More information about the TYPO3-dev
mailing list