news.Resource

Archive:

News-Feeds:


RSS 2.0
RSS 0.91
RDF
ATOM 0.3
Sponsors
hosting by snowflake | PREMIUM OPEN SOURCE
08.07.10 15:34 Age: 2 yrs

T3DD10: It's all about sprites

Category: www.typo3.org, Community

By: Steffen Ritter

Steffen Ritter and Steffen Gebert presented the technical changes in TYPO3 for the skinning of the back end at the Developer Days including the CSS sprite concept the UserExperience Week kicked off. Steffen Gebert has done a lot of work in implementing Lars Zimmermann's new design for the backend that started at last year's User eXperience Week while Steffen Ritter implemented "the sprite stuff". This article explains what CSS sprites is all about.

Sprite image

Sprite containing large number of images.

With TYPO3 version 4.4 we ship a fancy new backend design with the aim to make the heart of TYPO3 more usable and attractive to TYPO3 users. 

Reading the release notes, NEWS.txt and/or following the newsgroups you probably stumbled on one buzzword: "sprites".

For outsiders this might sound like "it's all about sprites". On further investigation you'll find sprites, a sprite-API, a sprite manager API, sprite manager handlers and a sprite generator.

But what is it really about:
The sprite API is the one you'll address for rendering icons in the backend, it's task is to generate html output for icon requests displayed in backend modules.

Therefore the sprite API relies on an internal cache storing the information about which icons are present in the system. This cache is managed by the sprite manager. The sprite manager API is the point where you might register your own icons. Then it takes care of CSS inclusion (for your sprites and icons), rebuilds the icon caches and might call the sprite generator (not included in 4.4) to build an sprite-image from single registered icons. Furthermore it takes care of automatically registering icons of your extension TCA-tables to be usable through sprite API.

The sprite generator is the most important part of this whole system of sprites-classes interacting. It has the task to collect single icons from the file system and build one sprite graphic and a CSS file addressing the single icons within the sprite as well as returning the icon names of the generated icons so that the sprite manager may add them to the icon cache. It is not included with version 4.4 and had been just an prototype for generating sprites shipped with this version.

Until now it's a finished class shipping with 4.5, which generated sprites 2-dimensional, allowing different image sizes within one sprite and aims to provide an easy to use interface that can be used by extension-developers directly f.e.: frontend-usage.

The Handlers for the Sprite Manager can be different implementations on how the sprite-manager builds and collects it's caches and information. Version 4.4 ships with a simple version just adding every single additional icon as background image, so that they are usable through sprite-API. For sure with this there is no speed-benefit.

The handler interface using the sprite Generator is not completely finished by now. We are at about 80% and going to ship in two different versions:

  1. generating sprites as often as needed
  2. regenerating sprites only on triggering

Conclusion:
The system of sprite-classes interact while each class has it's own task. The sprite manager mainly addresses the extension-developers, sprite-API the backend-module coders.

The future plan is supporting extension developers by providing a user-interface to the sprite generator in extdeveval so that extensions developers might ship their extensions with sprites instead of single icons or as an addition to them.

Further details can be found in doc_core_skinning.


comments

 
Sebastian Michaelsen 08-07-10 16:20  
It would be very cool if I could use sprites for an IMAGE Object. e.g. with an option .sprite = 1 Not an image-Tag but a the sprite-span will be returned.

 
Steffen Ritter 08-07-10 20:38  
@Sebastian
i do not think that this would be possible, or would have any benefit.
To use sth. as sprite, it has to be there before. on IMAGE it is probably to dynamic.

What i could imagine is sth. like

page.addIconsToSprite {
name1 = fileadmin/bla
}

lib.bla = SPRITE
lib.bla.name = name1

But as I already said, I'm not shure if this would be useful at all

 
Sebastian Michaelsen 09-07-10 01:12  
I think of graphical menus. If you have 10 menu items, with each a normal, hover and act state this are 30 gfx. It would be great if i could just hand that over to the sprite generator IMHO.

 
Guido Palacios 24-11-10 12:32  
like the comments before, it would be nice to have "sprites" in normal content elements (e.g. text/with image)

Maybe using an additional checkbox (using sprites?) which enables 2 extra input boxes (pos-x, pos-y)? or just the possibilty to give images a class/id tag?

This way requires the images are not getting processed by im/gm/gdlib (a copy to typo3temp or uploads), instead the images just should get referenced directly (e.g. filaadmin/images/mysprite.png). Otherwise there wouldn't be a benefit of low http request.

Another possiblity could be an extra option - "image already uploaded" - inside a CE. A list of already uploaded images (references) should be displayed.

hmmm, dunno how to handle this...

 
nemyweditty 12-01-12 06:07  
I like what you guys are up to. Such clever work and reporting! Keep up the excellent works guys. I’ve incorporated you guys to my blogroll. I think it will improve the value of my website. :)


<a href=http://the21dayfastmass.info>21 day fast mass building review</a>



<a href=http://the21dayfastmass.info>21 day fast mass building review</a>

Add comment