[TYPO3-dev] The "Object TypoScript library" in the TYPO3 core?

Steffen Kamper info at sk-typo3.de
Tue Jul 14 18:32:03 CEST 2009


Hi Steffen,

Steffen Müller schrieb:
> Hi.
> 
> On 13.07.2009 16:03 Steffen Kamper wrote:
>> I wrote this because i didn't found a tutorial doing this kind of stuff,
>> imho it's sufficient to do your own ContentElement and use it as the
>> others.
>>
> 
> Nice tutorial. I had to alter some things to make it work in the Backend:
> 
> --> ext_localconf.php:
> 
> t3lib_extMgm::addPageTSConfig('
> mod.wizards.newContentElement.wizardItems.special {
>   elements.myownce {
>     icon = EXT:myownce/icon_tx_myownce_myownce.gif
>     title = LLL:EXT:myownce/locallang.xml:tx_myownce_itemTitle
>     tt_content_defValues.CType = myownce
>   }
i didn't filled that in the tutorial because it differs with the new ce
>   show := addToList(myownce)
> }
> ');
> $TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClassDefault']['myownce']
> = 'EXT:myownce:class.tx_cobj_myownce.php:tx_cObj_myOwnCE';
> 
> 
> --> ext_tables.php:
> 
> $TCA['tt_content']['columns']['CType']['config']['items']['myownce'] =
> array(
>   '0' => 'LLL:EXT:myownce/locallang.xml:tx_myownce_CType.myownce',
>   '1' => 'myownce',
>   '2' => '../typo3conf/ext/myownce/icon_tx_myownce_myownce.gif',
> );
> t3lib_extMgm::addStaticFile('myownce', '/static/','My own CE');
> 
true :)
> --> class.tx_cobj_myownce.php:
> 
> if (defined('TYPO3_MODE') &&
> $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/myownce/class.tx_cobj_myownce.php'])
>        {
> 
> include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/myownce/class.tx_cobj_myownce.php']);
> }
> 
yes, xclass should be added as usual. I only posted the "main" things.
> 
> Or did I get something wrong?
> 
no

> Still I am fiddling with the Frontend part, which throws an exception:
> 
> Fatal error: Uncaught exception 'UnexpectedValueException' with message
> '$hookObject must implement interface tslib_content_cObjGetSingleHook'
> in
> /var/www/typo3_src/typo3_src-trunk/typo3/sysext/cms/tslib/class.tslib_content.php:614
> Stack trace:

as long as you don't activate autoloading your class must start with

require_once(PATH_tslib . 
'interfaces/interface.tslib_content_cobjgetsinglehook.php');

class tx_cObjMyOwnCE implements tslib_content_cObjGetSingleHook {
the rest of the errors are followups of first error.

vg Steffen




More information about the TYPO3-dev mailing list