Bug #22983
closed
Sprites - user defined page types are not respected anymore
Added by Steffen Kamper over 14 years ago.
Updated over 14 years ago.
Description
For marking pages i use often user defined icons.
Here is an example ho to do in extTables.php:
$TCA['pages']['columns']['module']['config']['items'][] = array('Pagetype 1', 'pagetype1', '../fileadmin/pageicons/asterisk_orange.png');
$TCA['pages']['columns']['module']['config']['items'][] = array('Pagetype 2', 'pagetype2', '../fileadmin/pageicons/award_star_bronze_1.png');
$TCA['pages']['columns']['module']['config']['items'][] = array('Pagetype 3', 'pagetype3', '../fileadmin/pageicons/award_star_silver_3.png');
$TCA['pages']['columns']['module']['config']['items'][] = array('Pagetype 4', 'pagetype4', '../fileadmin/pageicons/award_star_silver_2.png');
$TCA['pages']['columns']['module']['config']['items'][] = array('Pagetype 5', 'pagetype5', '../fileadmin/pageicons/award_star_gold_1.png');
$ICON_TYPES['pagetype1']['icon'] = '../fileadmin/pageicons/asterisk_orange.png';
$ICON_TYPES['pagetype2']['icon'] = '../fileadmin/pageicons/award_star_bronze_1.png';
$ICON_TYPES['pagetype3']['icon'] = '../fileadmin/pageicons/award_star_silver_3.png';
$ICON_TYPES['pagetype4']['icon'] = '../fileadmin/pageicons/award_star_silver_2.png';
$ICON_TYPES['pagetype5']['icon'] = '../fileadmin/pageicons/award_star_gold_1.png';
This does not work anymore. If i select one type in "Contains plugin" it's not used in page tree or elsewhere.
(issue imported from #M14849)
Files
Excactly the same problem I have :-)
there cannot be an automatic fallback
you have to register your icon to the srpitemanager:
/**
* static function to add a type-with icon to an already existent table which makes use of "typeicon_classes"
* feature or to provide icon for "modules" in pages table
* @param string $table the table the type has been added
* @param string $type the type - must equal the value of the column in the table
* @param string $iconFile relative to PATH_typo3
*/
public static function addTcaTypeIcon($table, $type, $iconFile) {
Brillant - In which file can I find the function and maybe an example?
There is nothing in 4.4 beta on TYPO3 unleashed?!
this has to be done in core - TCA definitions has to be automatic resolved.
@Claus Harup:
just Put:
t3lib_spritemanager::addTcaTypeIcon('tx_myext_table1','contains_MYstatus','../typo3conf/ext/my/ext/mygraphic.gif');
@ Steffen K:
no, there has been an explizit decision to do not.
Icons of records are considered as a skin issue,
there won't be a messing up of skin with such special things only present in one core table.
there is an break in backwards compatibility - right, but since we are had major version this belongs to cleanup which is normal.
Hi Steffen
Using t3lib_spritemanager::addTcaTypeIcon('pages', 'modules_denmark, t3lib_extMgm::extRelPath($_EXTKEY).'flags/flag_denmark.png);
Gives me:
[TBE_STYLES][spritemanager][singleIcons][tcarecords-pages-modules_denmark]=../typo3conf/ext/tcsys/flags/flag_denmark.png
.... but it still does not work?!?
after discussion with steffen we will provide an fallback triggering en depreciation entry
@Harup
type has to bee contains- instead of modules-
but we discovered a bug in this function anyways which is fixed in 4.4 and trunk
Okay - looking forward to 4.4.1 :-)
I simply can not get it to work!
Here is my code:
t3lib_spritemanager::addTcaTypeIcon('pages', 'contains-module_denmark, t3lib_extMgm::extRelPath($_EXTKEY).'flags/flag_denmark.png);
What am I doing wrong?
I also tried this now, but I wasn't able to figure out how to do it right. Any hints? Thanks a lot!
Also available in: Atom
PDF