Drupal is a registered trademark of Dries Buytaert
Release: Drupal 10.3.6 Update released for Drupal core (10.3.6)! Release: Drupal 11.0.5 Update released for Drupal core (11.0.5)! Release: Drupal 10.2.9 Update released for Drupal core (10.2.9)! Release: Drupal 10.2.10 Update released for Drupal core (10.2.10)! Release: Drupal 10.3.7 Update released for Drupal core (10.3.7)! Release: Drupal 11.0.6 Update released for Drupal core (11.0.6)! Release: Drupal 10.3.8 Update released for Drupal core (10.3.8)! Release: Drupal 11.0.7 Update released for Drupal core (11.0.7)! Module Revived: Translation Management Tool 8.x-1.19 Module tmgmt updated after 7 months of inactivity (8.x-1.19). Usage Milestone: Account field split Module account_field_split crossed 10,000 active installs.

Icon Select Module

This module allows you to upload and display SVG icons in the drupal backend. You can display these icons in your frontend theme using twig or render them as a fields.

Usage

  • Install the module using composer. This is important, because it will download a dependancy of SVGSanitizer. It will create a new vocabulary called "icons".
  • On the vocabulary, you can configure the path of the svg map in the public files folder.
  • Add some icons by using the "Add term" functionality. Please use SVGs that contain strokes and not just paths.
  • Create an entity reference field to a taxonomy term using the "icons" vocabulary
  • Change the Field Widget from "Autocomplete" to "Icon Select" and you will get a nice icon picker on the target entity
  • Change the Field Formatter to "SVG Icon"

Using icons in Twig templates

For all the frontend developers, I added a Twig Extension to easily add an svg icon somewhere in a theme or a module

The second parameter is optional.
{{ svg_icon('symbol-id', 'class1, class2') }}

Example:
{{ svg_icon('ui-check', 'icon--large') }}

Generate css sprites using drush command

drush generate-sprites

This will generates a sprite css from the icons/svgs folder
and place it in icons/css.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Sep 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Core Release date
3.0.1 Stable Sep 27, 2024
3.0.0 Stable Sep 27, 2024