Add your own icons in extension of typo3


 

The API also provides the possibility to include your extension’s icons using either single icons or your own icon sprite.
Using single icons can be done with the following code in your ext_tables.php or ext_localconf.php:

$icons = array(
     'myicon' => t3lib_extMgm::extRelPath('myextension') . 'myicon.gif'
);
t3lib_SpriteManager::addSingleIcons($icons, 'myextension');

If your extension comes with a larger amount of icons you might want to use your own sprite. This includes your sprite as a image file and a CSS file. The css file should look like this:

.t3-icon-extensions-myextension {  
	 background-image:url(../../typo3conf/ext/myextension/myextension_sprite.gif);  
}  
.t3-icon-extensions-myextension-icon1 { background-position: 0px 0px; }  
.t3-icon-extensions-myextension-icon2 { background-position: 0px -16px; }  

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s