[TYPO3-core] RFC #13379: Sprite Icon API

Thomas Allmer at at delusionworld.com
Sun May 2 00:33:07 CEST 2010


On 01.05.2010 21:59, Steffen Kamper wrote:
> Steffen Kamper schrieb:
>> Hi,
>>
>> here is the CGL-cleaned v8 (from v7b)
>>
>> so my +1 by reading and testing
>>
>> vg Steffen
>
> lol - senseless without the patch ...
>
> vg Steffen

Hi,

so I also tested this and most of the stuff worked.
However the buildTcaSpriteIconNames did not work. I tested it with 
tt_address and the relative path was wrong.

created file is: typo3temp/spriteapi/zextensions.css

.t3-icon-tt_address-default {
   background-position: 0px 0px !important;
   background-image: url('../typo3conf/ext/tt_address/ext_icon.gif') 
!important;
}

so it need needs two "../" to work... It also created stuff like this for me
.t3-icon-be_users-0 {
   background-position: 0px 0px !important;
   background-image: url('sysext/t3skin/icons/gfx/i/') !important;
}
which is simply wrong CSS...

However this all really doesn't matter as in my opinion it's wrong 
altogether.

Creating valid css files should NOT be part of this API. This api is 
about creating spans with proper classes. The nice thing about this is 
that you don't need to care about paths as they are inside the css.

Automatically creating correct css files for the sprites should be part 
of a "spritegenerator".

So again I think people getting ahead of the task. This is about the api 
howto create spans with css classes - nothing more.

With this approach now every time an icon for a record is created it 
checks if anything in the TCA changed?

I would find it much better to do this after an extension is installed. 
For backward compatibility you could make sure that every extension 
get's a proper "typeicon_classes"; However as stated this should be part 
of a spritegenerator. This now is a mix of generator and sprite API... 
which is not good in my opinion.

Most of the other changes; Function Names and splitting of some stuff is 
good and makes it easier to read.

I won't block this patch as I think it's still better than nothing and 
can be changed/improved once we have a proper spritegenerator.

Just to say it once again; I believe the commit plan should look 
something like this:
1) sprite Icon API (just spans with classes)
2) spritegenerator (create css and image files) [with some backward 
compatibility "features/hacks"]
3) prepare a complete icon set (there are still quite some icons 
missing; I have a list if anyone is interested [already sent it to Andre 
and Jens some time ago])
4) replace all the calls in the core

With 1-3 you don't do any harm, but you won't see any changed stuff. 
(unless you apply the patch (4) manually; for example if you are working 
on it or testing it) Once everything is ready which means all icons + 
sprite images + sprite css + api then commit the patch for the core 
replacements.

just my 2 cents

PS: one more thing "$iconPath = '../../typo3/';" this variable is never 
us afterward? is it needed at all?

-- 
+---------------------------------+-----------------------------------+
| Thomas Allmer                   |   http://www.delusionworld.com    |
| E-mail: at at delusionworld.com    |   phone: +43 699 16217064         |
+---------------------------------+-----------------------------------+


More information about the TYPO3-team-core mailing list