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

Benjamin Mack benni at typo3.org
Sun May 2 17:40:05 CEST 2010


Hey Thomas,

thanks for your feedback.

The comments about the wrong CSS path have been taking into account and 
were basically just a wrong copy/paste issue of myself. v10 (see my 
other post) fixes this and works like a charm on DB records.

I also agree that creating CSS files should *not* be part of the API. 
However, if we finally want to get this feature in, we need to have some 
kind of backwards-compatibility for TCA records (as you mentioned 
yourself), at least for now!
I also agree that this function is part of a "sprite generator" API 
however that's a separate issue that will be tackled *after* this sprite 
API was finally committed.
You know how things are, and this patch has been flying around since 
such a long time now, adding all the other things to it would just made 
it worse to review, and that's also (at least my understanding) one of 
the reasons you stopped working on it, as you had the feeling it would 
never go in the Core.

This patch is part 1 of your four points, which I think is a good 
approach. The way we chose it now is that we can now work on multiple 
issues simultaneously, which would be

  * to find all spots in the BE where we can use the Sprite API
  * keep backwards compatibility
  * to finally get a sprite generator in place

You also noticed that buildTcaSpriteIconNames() is protected, which 
means that it is *not* part of the public API but just a helper 
function. So it will be easy to remove that function again, which I 
don't have any problems with it as soon as the *real* sprite generator 
API is in place. However, as you also know, Steffen Ritter and me were 
sitting on this task basically the last 48hs to make this part at least 
ready for the Core.

I'm also interested in the list of missing icons, so I can ask Jens again.

So, thanks for not blocking, and you're more than welcome to help out 
with the rest of the tasks, as it's really a huge job to do!

All the best,
Benni.

On 02.05.10 00:33, Thomas Allmer wrote:
> 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



More information about the TYPO3-team-core mailing list