[TYPO3-english] adding new pagetype (icon fails)

Josef Florian Glatz typo3 at josdesign.at
Thu Mar 24 10:50:26 CET 2011


Am 24.03.2011 08:59, schrieb Josef Florian Glatz:
> Am 23.03.2011 19:26, schrieb Kay Strobach:
>> Hello Josef,
>>
>> this way adds a new module icon (like the one for tt_news).
>> I don't know if it was exactly what you wanted.
>> The ^^ sings define the name of the module and how the icon is bound to
>> which value.
>>
>> If you wanna add an additional PageType beside standard, shortcut,
>> sysfolder, you may also load the tca and than add new items.
>>
>> Take a look into the following file around line 717, there is should be
>> anything related to pagetypes ;)
>>
>> typo3/sysext/cms/tbl_cms.php
>>
>> Regards
>> Kay
>>
>> Am 23.03.2011 09:55, schrieb Josef Florian Glatz:
>>> Am 22.03.2011 21:18, schrieb Kay Strobach:
>>>> if (TYPO3_MODE == 'BE') {
>>>> t3lib_div::loadTCA('pages');
>>>> $TCA['pages']['columns']['module']['config']['items'][] = array(
>>>>
>>>> 'LLL:EXT:sitemgr/Resources/Private/Language/locallang_db.xml:tx_sitemgr_customer',
>>>>
>>>>
>>>> 'sitemgr'
>>
>> ^^
>>
>>>> );
>>>> t3lib_SpriteManager::addTcaTypeIcon('pages', 'contains-sitemgr',
>>
>> ^^
>>
>>>> t3lib_extMgm::extRelPath($_EXTKEY).'ext_icon.gif');
>>>> #$ICON_TYPES['sitemgr'] = array('icon' =>
>>>> t3lib_extMgm::extRelPath($_EXTKEY).'ext_icon.gif');
>>>> }
>>>
>>> thx kay for your answer!
>>>
>>> but where can I define the doktype-id (e.g. 45)
>>>
>>
>>
>
> Thx for answer,
>
>
> for adding icons to pages I use
>
> t3lib_SpriteManager::addTcaTypeIcon('pages', 'contains-folderhead',
> '../fileadmin/pagetypes/text_heading_3.png');
> $TCA['pages']['columns']['module']['config']['items'][] =
> array('Headline', 'folderhead',
> '../fileadmin/pagetypes/text_heading_3.png');
>
>
>
> And there's also a way to add/define a doktype via TCEFORM:
> TCEFORM.pages.doktype {
> addItems.44 = Sponsor Image
> addItems.45 = LLL:EXT:lang/locallang_tca.php:heading
> }
>
>
>
> But I want to add a new doktype via ext_tables.php in my extension, that
> I can define a fix icon for new doktype.
>
> Now I've only one thing that is missing! This is my code, I hope this is
> correct cgl and current api... (ext_tables.php in my own extension:)
>
> t3lib_div::loadTCA('pages');
>
> $pageItems = &$TCA['pages']['columns']['doktype']['config']['items'];
>
> // DokType 54
> $PAGES_TYPES['54'] = array(
> 'type' => '',
> 'allowedTables' => '',
> 'onlyAllowedTables' => '0'
> );
> t3lib_SpriteManager::addTcaTypeIcon('pages', '54',
> '../fileadmin/pagetypes/image.png');
> array_push($pageItems, array('Sponsor Image (new)', '54'));
>
>
> The only one thing which is missing:
>
> In the SELECT where you can choose a DokType: Icon doesn't appear.
> Is it possible to fix that also?
>
> thx in advance
>
>

Okay...

here's my solution:

t3lib_div::loadTCA('pages');

$pageItems = &$TCA['pages']['columns']['doktype']['config']['items'];

// DokType 44
$PAGES_TYPES['44'] = array(
	'type' => '',
	'allowedTables' => '',
	'onlyAllowedTables' => '0'
);
t3lib_SpriteManager::addTcaTypeIcon('pages', '44', 
'../fileadmin/pagetypes/image.png');
array_push($pageItems, array('Sponsor Image', '44', 
'../fileadmin/pagetypes/image.png'));


Is that actually correct in TYPO3 4.5?


-- 
Regards,
Josef Florian Glatz
http://typo3blog.at | http://josdesign.at


More information about the TYPO3-english mailing list