How to set the minimum and maximum ranges of style customizer sliders in 5.7

This is a community-contributed tutorial. This tutorial is over a year old and may not apply to your version of Concrete CMS.
Jul 12, 2015

In Concrete CMS 5.7, you can apply custom styles to blocks and block areas using sliders. By default the slider minimum is -50 and the maximum is 200. This can be changed by overriding the default configuration values.

The configuration settings are stored in a multidimensional array in concrete\config\concrete.php.

An example of how configuration settings are stored as arrays.

concrete.limits.style_customizer.size_min

concrete. (filename.php)
    limits. (array key)
        style_customizer. (array key)
            size_min (array key)

Default Slider Values

alt text

In this example, you will be setting the slider minimum to -100 and the maximum to 300.

In your application\config folder, open concrete.php. If you don't have a concrete.php file, you will need to create one. The concrete.php file will only contain PHP, so only an opening PHP tag is required. Paste the following code into concrete.php.

return array(
    'limits' => array(
        'style_customizer' => array(
            'size_min' => -100,
            'size_max' => 300
        )
    )
);

If concrete.php exists and already has arrays of configuration settings. Add a comma after the last first level subarray (not the returned array) and then paste the slider configuration settings after the comma.

Example: existing array

return array(
    'marketplace' => array(
        'enabled' => false
    ),
    'external' => array(
        'news_overlay' => false,
        'news' => false,
    )
);

-- 'external' is the last first level subarray

Example: slider configuration settings

'limits' => array(
    'style_customizer' => array(
        'size_min' => -100,
        'size_max' => 300
    )
)

Example: adding to the existing array

return array(
    'marketplace' => array(
        'enabled' => false
    ),
    'external' => array(
        'news_overlay' => false,
        'news' => false,
    ),
    'limits' => array(
        'style_customizer' => array(
            'size_min' => -100,
            'size_max' => 300
        )
    )
);

The size_min and size_max values are both integers. When used by the sliders, these values will be in pixels (-100 pixels and 300 pixels).

Custom Slider Values

alt text

Recent Tutorials
Reusing the same Express entity in multiple associations
Apr 11, 2024
By myq.

How to create and manage multiple associations in Express

Express Form Styling
Apr 11, 2024
By myq.

Different ways to style Express forms

Setting addon/theme version compatibility in the marketplace
Jan 9, 2024

For developers worn out with setting the latest addon or theme version manually across too many core versions, here is a JavaScript bookmarklet to do it for you.

How to get the locale of a page
Jan 8, 2024
By wtfdesign.

Now, why don't we just have a getLocale() method on Page objects beats me, but here's how you work around it

Using a Redis Server
Jun 16, 2023
By mlocati.

How to configure Concrete to use one or more Redis servers to persist the cache.

Using the Concrete Migration Tool Addon
Apr 27, 2023

How to use the Concrete CMS Migration Tool

Improvements?

Let us know by posting here.