This module provides integration for icon bundles and icon providers throughout Drupal.

Integrations

  • icon_block - icon support for blocks.
  • icon_menu - icon support for menu items.
  • icon_field - icon support on field-able entities.
  • icon_filter - icon support as a filter for text-area fields.

Providers (via module or theme)

API/Documentation

Icon API comes with extensive documentation on how to integrate your module or service provider. If you need additional help, look at the previously mentioned providers for examples.

Icon Filter Sub-Module

Add an icon inside formatted text-area fields that have the icon filter enabled: [icon:%bundle:%icon].
%bundle is the bundle machine name, like: my_bundle
%icon is the icon machine name, like: my_icon

Usage in Code

All you need to know is the bundle's machine name and the icon machine name, Icon API handles the rest!

  $element[] = array(
    '#theme' => 'icon',
    '#bundle' => 'my_bundle',
    '#icon' => 'my_icon',
  );
  print drupal_render($element);

Project information

Releases