Last updated March 14, 2011. Created by Scyther on March 13, 2011.
Log in to edit this page.

Learn how to add a additional icon set to Country Icons.

6.x-1.x and 7.x-1.x

@todo: text ...

6.x-2.x and 7.x-2.x

In this version of Country Icons, icon sets are modules.

Create a new module, if you don't know read this. In this example our module will be called countryicons_iconset_example

Use hook_iconset_info() to define you iconset to Country Icons.

<?php
function countryicons_iconset_example_iconset_info() {
 
// key for the iconset should be uniq from the other iconsets.
  // you could use your module name, but it's not necessary
 
$icon->key = 'example_iconset';
 
// name for the iconset, could be passed throught t() to translate it
 
$icon->name = t('Example Iconset');
 
// a short description about the iconset
 
$icon->description t('This is a example of an iconset.');
 
// width of the images
 
$icon->image_width = 16;
 
// height of the images
 
$icon->image_height = 11;
 
// file extension for the images
 
$icon->image_extension = 'png';
 
// path to image folder, do not include ending "/"
 
$icon->image_path = '';
 
// do this iconset supports CSS sprite technique?
 
$icon->sprite = TRUE;
 
// if $icon->sprite is TRUE
  // you need to set the path to the css file for the CSS sprite.
 
$icon->sprite_css = '';
  return array(
$icon->key => $icon);
}
All icons name should be in lowercase and is is recommendet to be PNG (or GIF). The name should be the ISO*** 2-digit country code.
A 'unknown' image should be created that are in the same size as all the other icons and should be transparent.
@
todo: complete text.
?>

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.