^ Sounds like a better solution.
Alternatively though, create a listbox TV with this input option value:
Create a chunk called FontAwesome with this snippet called inside:
Create a snippet called FontAwesome:
<?php
// source file
$cssUrl = $modx->getOption('cssUrl', $scriptProperties, 'https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css');
// scan options
$regexPrefix = $modx->getOption('regexPrefix', $scriptProperties, 'fa-');
// label text output options
$mode = $modx->getOption('mode', $scriptProperties, 'tv'); // can be 'tv' or 'cb'
$titleCaseLabels = $modx->getOption('titleCaseLabels', $scriptProperties, 1);
$operator = $modx->getOption('operator', $scriptProperties, '');
if (empty($operator)) {
$operator = ($mode === 'cb') ? '=' : '==';
}
// value text output options
$outputPrefix = $modx->getOption('classPrefix', $scriptProperties, 'fa-');
// list output options
$separator = $modx->getOption('separator', $scriptProperties, '');
if (empty($separator)) {
$separator = ($mode === 'cb') ? "\n" : '||';
}
$excludeClasses = array_filter(array_map('trim', explode(',', $modx->getOption('excludeClasses', $scriptProperties, 'ul,li'))));
// check cache
$cacheKey = $modx->getOption('cacheKey', $scriptProperties, 'fontawesomecsssource');
$provider = $modx->cacheManager->getCacheProvider('default');
$css = $provider->get($cacheKey);
if (!$css) {
// get source file
$css = file_get_contents($cssUrl);
if ($css) {
$provider->set($cacheKey, $css, 0);
} else {
$modx->log(modX::LOG_LEVEL_ERROR, '[fontAwesomeInputOptions] could not get css source!');
return '';
}
}
// output
$output = array();
$regex = "/\." . $regexPrefix . "([\w-]*)/";
if (preg_match_all($regex, $css, $matches)) {
$icons = array_diff($matches[1], $excludeClasses);
foreach($icons as $icon) {
$label = ($titleCaseLabels) ? ucwords(str_replace('-', ' ', $icon)) : $icon;
$output[] = $label . $operator . $outputPrefix . $icon;
}
}
return implode($separator, $output);