Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Drupal 8 module. Use jQuery plugin Select2 dropdown to select an icon from a given list.

License

Notifications You must be signed in to change notification settings

wearewondrous/icon_select_field

Repository files navigation

icon_select_field

Drupal 8 module. Special Dropdown to indicate color of a stripe. It's also compatible with Drupal 9.

Usage

After install you will find a new field Type. Use as desired. Go to the settings page /admin/config/content/icon_select_field and add the needed colors.

We normally add the new field named Icon Select. Then in the field--field-icon-select.html.twig we put the following:

<i class="{{ element['#items'].getString }}"></i>

Since you can include SVG files directly in D8 twig, an other way would be like this:

{% include directory ~ '/icons/' ~ content.field_icon_select['#items'].getstring|replace({'icon-': ''})|trim ~ '.svg' %}

Demo Screen

When placed into a field, it looks like this:

Backend settings page

Credits

code base: github.com/wearewondrous/icon_select_field

developed by WONDROUS LLC

About

Drupal 8 module. Use jQuery plugin Select2 dropdown to select an icon from a given list.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published