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

Steffen Müller typo3 at t3node.com
Tue Jul 14 18:22:11 CEST 2009


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
  }
  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');

--> 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']);
}


Or did I get something wrong?

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:
#0
/var/www/typo3_src/typo3_src-trunk/typo3/sysext/cms/tslib/class.tslib_content.php(466):
tslib_cObj->cObjGetSingle('MYOWNCE', Array, '20')
#1
/var/www/typo3_src/typo3_src-trunk/typo3/sysext/cms/tslib/class.tslib_content.php(709):
tslib_cObj->cObjGet(Array)
#2
/var/www/typo3_src/typo3_src-trunk/typo3/sysext/cms/tslib/class.tslib_content.php(523):
tslib_cObj->COBJ_ARRAY(Array)
#3
/var/www/typo3_src/typo3_src-trunk/typo3/sysext/cms/tslib/class.tslib_content.php(1633):
tslib_cObj->cObjGetSingle('COA', Array, 'myownce')
#4
/var/www/typo3_src/typo3_src-trunk/typo3/sysext/cms/tslib/class.tslib_content.php(571):
tslib_cObj->CASEFUNC(Array)
#5
/var/www/typo3_src/typo3_src-trunk/typo3/sysext/cms/tslib/class.tslib_content.php(504):
tslib_cObj->cObjGetSingle('CASE', Array, 'tt_content')
#6 / in
/var/www/typo3_src/typo3_src-trunk/typo3/sysext/cms/tslib/class.tslib_content.php
on line 614


-- 
cheers,
Steffen

TYPO3 Blog: http://www.t3node.com/
Blubber on Twitter: http://twitter.com/t3node




More information about the TYPO3-dev mailing list