SelectizeAll by Robin S

Enables Selectize on all InputfieldSelect and InputfieldAsmSelect fields in the ProcessWire admin.

Selectize All

Enables Selectize on all InputfieldSelect and InputfieldAsmSelect fields in the ProcessWire admin.

The module activates Selectize on the <select> element when it is focused, and destroys Selectize when the element is blurred. This allows Selectize to work on selects where the options are changed dynamically after page load depending on other field values, e.g. the "Select File" field in the CKEditor link modal or a dependent select in Page Edit.

Only AdminThemeUikit is tested and supported.

selectize-select

selectize-asm

Usage


In the module config you can choose if Selectize should be used with InputfieldSelect, InputfieldAsmSelect, or both.

If you want to disable the module for a specific Select or AsmSelect inputfield you can hook SelectizeAll::allowSelectize. This method receives the Inputfield object as the first argument.

Example:

$wire->addHookAfter('SelectizeAll::allowSelectize', function(HookEvent $event) {
    $inputfield = $event->arguments(0);
    // You can also get any associated Page and Field objects via $inputfield->hasPage and $inputfield->hasField

    // Disable the module for the inputfield named "template"
    if($inputfield->name === 'template') $event->return = false;
});

If you are creating an inputfield via the API (e.g. in a custom module) you can also disable SelectizeAll for the inputfield by giving it a "no-selectize" class, e.g.

$inputfield->addClass('no-selectize');

Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Latest news

  • ProcessWire Weekly #518
    The 518th issue of ProcessWire Weekly brings in all the latest news from the ProcessWire community. Modules, sites, and more. Read on!
    Weekly.pw / 13 April 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 2024
  • Subscribe to weekly ProcessWire news

“Yesterday I sent the client a short documentation for their ProcessWire-powered website. Today all features already used with no questions. #cmsdoneright—Marc Hinse, Web designer/developer