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

Thomas Allmer at at delusionworld.com
Sun Jan 31 16:55:50 CET 2010


Hi!

This is a SVN patch request.

Type: Feature

Bugtracker references:
http://bugs.typo3.org/view.php?id=13379

Branches: Trunk

Problem:
Currently the icons are single image files which results in a lot of 
requests and can't be changed by css only.

Solution:
The attached patch introduces an API for the use of sprites with icons.

Excerpt from the Documentation: (full version at bugtracker 
http://bugs.typo3.org/file_download.php?file_id=10049&type=bug
or in the code)
SPRITE ICON API

The sprite icons are a completely different approach than using single 
file images. In order to get a icon you don't need to know anything 
about a file or whatever. The only thing you need to know are the css 
classes used. This api even helps you with that by only needing a single 
string name for an icon. You should always look up this "iconName" in 
the Skinning Manual.

Example: display an icon for creating a new document/page content element
Usage: t3lib_iconWorks::getSpriteIcon('actions-document-new');
Result: <span class="t3-icon t3-icon-actions-document 
t3-icon-document-new "> </span>

== patching instructions ==
This patch consists of multiple files:
spriteIconAPI.patch - contains the logic that should be submitted

spriteReplace.patch - replaces most of the skinImg calls in the core; 
this is for showing how it the API will work and that you see it 
working; there will be separate RFC for replacing all skinImg calls once 
the API has been included.

sprites_css_t3skin.zip - contains the sprites and css used. This needs 
the patch #13131 to be applied. Extract it directly in your typo3_src 
folder; This file will replace "typo3/sysext/t3skin/ext_tables.php"; add 
sprite images to "typo3/sysext/t3skin/images/sprites/"; add sprite css 
to "typo3/sysext/t3skin/stylesheets/sprites/". Where the sprites css and 
sprite images are placed and how they are generated is not part of this RFC.

Note: In this example there are a few missing icons, mainly for the 
different file extension. The code is still working, but the css and 
sprites have to be added. Also the Skinning manual will have to adopt these.

Note: this code is also on github so you can explore it and get a full 
version with all patches applied if you want to.
http://github.com/daKmoR/typo3v4core/tree/spriteExample

BTW: This is part of the work done by Team3/Team4 @ T3UXW09 and will be 
continued by some further patches, to e.g. replacing all skinImg calls

cheers
-- 
+---------------------------------+-----------------------------------+
| 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