PHPackages                             contao-graveyard/stylepicker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. contao-graveyard/stylepicker

ActiveContao-bundle[Utility &amp; Helpers](/categories/utility)

contao-graveyard/stylepicker
============================

CSS Class selection wizard for contao

2.2.4(11y ago)00LGPL-3.0+PHPPHP &gt;=5.3

Since Jul 16Pushed 5mo agoCompare

[ Source](https://github.com/contao-graveyard/stylepicker)[ Packagist](https://packagist.org/packages/contao-graveyard/stylepicker)[ Docs](https://github.com/psi-4ward/stylepicker4ward)[ RSS](/packages/contao-graveyard-stylepicker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (14)Used By (0)

Caution

USE AT YOUR OWN RISK / Do not use in production

This plugin has been revived as an example for a conference talk at the contao conference in 2025. Whilst most, if not all the functionality is given, this extension should most likely not be used in production at all.

Contao StylePicker (formerly known as stylepicker4ward)
=======================================================

[](#contao-stylepicker-formerly-known-as-stylepicker4ward)

 [![github version](https://camo.githubusercontent.com/1f71f6413425e3f0d39492607dcf57a4ee3040d0fec0c6254108e55d623290c8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f636f6e74616f2d6772617665796172642f7374796c657069636b6572)](https://github.com/contao-graveyard/stylepicker) [![amount of downloads](https://camo.githubusercontent.com/96f95f9ad7adb90c1e8e198dbacfd20f95f1ad3328551d5af869808f6b1e9ffa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f6e74616f2d6772617665796172642f7374796c657069636b65723f636f6c6f723d663437633030)](https://packagist.org/packages/contao-graveyard/stylepicker) [![minimum php version](https://camo.githubusercontent.com/2585c3a1d15413dba7580f66052c31dde612be1797159b5545a016778d6bccfe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f636f6e74616f2d6772617665796172642f7374796c657069636b65722f7068703f636f6c6f723d343734413841)](https://packagist.org/packages/contao-graveyard/stylepicker)

Description
-----------

[](#description)

This bundle adds the possibility to easily select a css-class from a predefined list.

Installation
------------

[](#installation)

### Via composer

[](#via-composer)

```
composer require contao-graveyard/stylepicker

```

Events
------

[](#events)

### GetStylePickerEvent

[](#getstylepickerevent)

Formerly known as the `stylepicker4ward_getFilter` Hook, the new implementation happens as a Symfony event that you can listen to. Please mind that the examples below need either autowiring to be on or need your own service tagging.

**Old implementation**

```
/*
 * HOOK to get table,PID(s),section and condition
 * in-parameter: str $table, int $id
 * out-parameter as array or FALSE if the callback does not match:
 * 		array($tbl,$pids,$sec,$cond)
 * 		str $tbl: table name, mostly the same as from the in-parameter
 * 		array $layout: ID of Pagelayout
 * 		str $sec: a section (column) identifier
 * 		str $cond: some addition condition
 */
if (isset($GLOBALS['TL_HOOKS']['stylepicker4ward_getFilter']) && is_array($GLOBALS['TL_HOOKS']['stylepicker4ward_getFilter'])) {
    foreach ($GLOBALS['TL_HOOKS']['stylepicker4ward_getFilter'] as $callback) {
        System::importStatic($callback[0]);
        $result = $this->{$callback[0]}->{$callback[1]}($table, $id);
        if (is_array($result)) {
            [$table, $layout, $section, $condition] = $result;
            break;
        }
    }
}
```

#### Defining in a class

[](#defining-in-a-class)

```
