Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
select_icons
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
select_icons
Commits
cd101011
Commit
cd101011
authored
3 years ago
by
Florent Torregrosa
Committed by
Florent Torregrosa
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3265455
by Grimreaper: Add README.md file and update project page
parent
fbbe68f6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+87
-0
87 additions, 0 deletions
README.md
select_icons.libraries.yml
+0
-1
0 additions, 1 deletion
select_icons.libraries.yml
with
87 additions
and
1 deletion
README.md
0 → 100644
+
87
−
0
View file @
cd101011
ENTITY ACCESS PASSWORD
----------------------
*
Introduction
*
Requirements
*
Similar modules
*
Installation
*
Configuration
*
Maintainers
INTRODUCTION
------------
This module provides a Form API select element with icons using jQuery UI.
This module is for developers only. It does not provide any user functionality.
With Select icons you can easily create select element with icons of your choice
using nothing but drupal Forms API and some CSS:
```
php
$form
[
'fancy_select'
]
=
[
'#type'
=>
'select_icons'
,
'#title'
=>
$this
->
t
(
'Color'
),
'#options'
=>
[
'r'
=>
$this
->
t
(
'Red'
),
'g'
=>
$this
->
t
(
'Green'
),
'b'
=>
$this
->
t
(
'Blue'
),
],
// This is where magic happens:
// CSS classes from 'data-class' attribute are used in JavaScript
// when building jQuery UI selectmenu widget.
'#options_attributes'
=>
[
'r'
=>
new
Attribute
([
'data-class'
=>
[
'colour'
,
'red'
]]),
'g'
=>
new
Attribute
([
'data-class'
=>
[
'colour'
,
'green'
]]),
'b'
=>
new
Attribute
([
'data-class'
=>
[
'colour'
,
'blue'
]]),
],
// Don't forget to add proper CSS that will provide icons.
// It is recommended to use sprite sheets for better performance.
'#attached'
=>
[
'library'
=>
[
'my/colours'
]
],
];
```
REQUIREMENTS
------------
This module requires the following modules:
*
jQuery UI Selectmenu Widget (https://www.drupal.org/project/jquery_ui_selectmenu)
SIMILAR MODULES
---------------
*
Select2 Boxes (https://www.drupal.org/project/select2boxes):
Select2 Boxes integrates with Select2 library and provides field widget
plugins while Select Icons integrates with jQuery UI and is for developer.
INSTALLATION
------------
*
Install as you would normally install a contributed Drupal module. See:
https://www.drupal.org/docs/extending-drupal/installing-modules
for further information.
CONFIGURATION
-------------
The module has no menu or modifiable settings. There is no configuration.
MAINTAINERS
-----------
Current maintainers:
*
Florent Torregrosa (Grimreaper) - https://www.drupal.org/user/2388214
Previous maintainers:
*
SiliconMind - https://www.drupal.org/user/90277
*
vlad.dancer - https://www.drupal.org/user/903844
This project has been sponsored by:
*
Globalbility - https://www.drupal.org/globalbility
Sponsored initial development.
This diff is collapsed.
Click to expand it.
select_icons.libraries.yml
+
0
−
1
View file @
cd101011
selecticons
:
version
:
VERSION
js
:
js/ui.selecticons.js
:
{}
css
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment