Download the PHP package manuxi/sulu-content-types-bundle without Composer
On this page you can find all versions of the php package manuxi/sulu-content-types-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download manuxi/sulu-content-types-bundle
More information about manuxi/sulu-content-types-bundle
Files in manuxi/sulu-content-types-bundle
Package sulu-content-types-bundle
Short Description Custom Content Types for Sulu CMS: NumberWithDefault, ColorSelect, SliderRange
License MIT
Informations about the package sulu-content-types-bundle
Sulu Content Types Bundle
Custom Content Types for Sulu CMS 2.6+
Deutsche Version | English Version
Features
This bundle provides three custom content types for Sulu CMS:
1. 🔢 NumberWithDefault
Number input field with default value support. Extends the standard number type with a default_value parameter.
Use Cases:
- Refresh intervals
- Timeouts
- Counters with default values
2. 🎨 ColorSelect
Selection field with colour preview. Any colour-coded options can be configured via yaml.
Use Cases:
- Button colors
- Badge colors
- Theme color selection
Default options (Palette "bootstrap"):
3. 🎚️ SliderRange
Visual range slider with configurable display modes. Supports textbox input, floating tooltips, and various label layouts.
Use Cases:
- Banner rotation speeds
- Opacity/transparency
- Priority levels
- Volume controls
Installation
1. Install via Composer
2. Enable the Bundle
Add the bundle to your config/bundles.php:
3. Register Admin Assets
Add to your main project's assets/admin/package.json:
4. Import in Main Project
Add to your main project's assets/admin/index.js:
5. Build Admin Assets
6. Clear Cache
Usage
NumberWithDefault
In Twig:
ColorSelect
Important: The color is encoded in the value attribute using the format "key:color" (e.g., "primary:#0d6efd").
In Twig:
The value returned is only the key part (e.g., "primary"), not the full "primary:#0d6efd" string.
SliderRange
The SliderRange supports multiple display modes via the display_mode parameter:
In Twig:
Parameters
NumberWithDefault
| Parameter | Type | Description | Example |
|---|---|---|---|
min |
number | Minimum value | 0 |
max |
number | Maximum value | 100 |
step |
number | Step increment | 1 |
multiple_of |
number | Value must be multiple of | 5 |
default_value |
number | Default value | 10 |
ColorSelect
| Parameter | Type | Description |
|---|---|---|
values |
collection | Array of color options |
values.* |
value attribute | Key and color in format "key:color" |
values.*.meta.title |
string | Translatable display name (optional) |
Value Format: "key:#hexcolor" (e.g., "primary:#0d6efd")
XML Structure:
ColorSelect Color Palettes
Using palettes with service:
Custom color palette: config/packages/sulu_content_types.yaml
Reflect changes in xml: .getValues('custom')
Now use own color palette:
SliderRange
| Parameter | Type | Description | Default | Example |
|---|---|---|---|---|
min |
number | Minimum value | 0 |
0 |
max |
number | Maximum value | 100 |
100 |
step |
number | Step increment | 1 |
5 |
default_value |
number | Default value | min |
50 |
display_mode |
string | Display mode (see below) | input |
floating |
show_labels |
boolean | Show min/max labels | true |
false |
Display Modes
| Mode | Description | Best For |
|---|---|---|
input |
Textbox next to slider with min/max labels | Full-width layouts, precise input needed |
floating |
Tooltip above thumb, smooth animation | Narrow columns (col-3), clean design |
inline |
Current value between min/max labels | Compact layouts |
below |
Current value centered below slider | Minimal layouts, emphasis on value |
none |
No value display, only slider | Ultra-minimal, visual-only control |
Recommended Combinations:
- 📱 Narrow columns (col-3):
display_mode="floating"+show_labels="false" - 📊 Full width:
display_mode="input"+show_labels="true" - 🎨 Minimalist:
display_mode="below"+show_labels="false"
Development
Project Structure
Compatibility
- Sulu CMS: ^2.6
- PHP: ^8.1
- Symfony: ^5.4 || ^6.0 || ^7.0
- React: ^17.0.0 || ^18.0.0
Future Compatibility
This bundle is designed with Sulu 3.x compatibility in mind:
- Uses SimpleContentType without PHPCR dependencies
- No direct PHPCR write/read methods
- Future-proof architecture
Documentation
- Installation Guide - Step-by-step installation
- Example Template - Complete XML examples
- Example Twig - Twig usage examples
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This bundle is under the MIT license. See the complete license in:
LICENSE
Credits
Created and maintained by Manuxi
Support
- Issues: GitHub Issues
- Discussions: Sulu Slack
Roadmap
Planned features for future versions:
- IconSelect (FontAwesome, Material Icons)
- PercentageSlider (with % display)
- CurrencyInput (with currency symbols)
- DateRangePicker
- TimeRangePicker
Changelog
See CHANGELOG.md for version history.
All versions of sulu-content-types-bundle with dependencies
sulu/sulu Version ^2.6
symfony/config Version ^5.4 || ^6.0 || ^7.0
symfony/dependency-injection Version ^5.4 || ^6.0 || ^7.0
symfony/http-kernel Version ^5.4 || ^6.0 || ^7.0