October CMS 3.7 - Feature Release

Release Note 38

Version 3.7 of October CMS contains feature improvements to the platform, including new currency tools, theme blueprints and improvements to the resizer.

Table of Contents

New Currency Tools

New tools have been added for currency management, including prices and quotes. The features are implemented by the official Currency plugin.

This includes a form field for entering price values.

# Form Field
total_amount:
    label: Total amount
    type: currency

A list column to accompany it and display the price in a currency.

# List Column
total_amount:
    label: Loan amount
    type: currency

A |currency Twig filter for displaying currencies on the front-end.

{{ 100|currency }}

Record Finder Content Field

A new content field for associating Tailor models to regular models has been added. When the recordfinder field is used as a content field in Tailor, it requires the modelClass property to be specified to define and locate the model relation.

products:
    label: Products
    type: recordfinder
    modelClass: Acme\Test\Models\Product
    list: $/october/test/models/product/columns.yaml

Resizer Grouped Folders

The |resize Twig filter now takes an optional group parameter that removes the unique hash found at the end of the resized file. This particularly useful for SEO purposes.

<img src="{{ 'banner.jpg'|resize(800, 600, {
    filename: 'my-seo-friendly-name',
    group: '2024-banners'
}) }}" />

For example, the above will place the file in the following directory:

.../800_600_0_0_auto/2024-banners/my-seo-friendly-name.png

Detailed Option Definitions

The checkboxlist, dropdown and radio form fields have been enhanced to support more detailed definitions, , such as setting individual attributes for each option. A detailed definition is identified by its associated array structure.

public function getDetailedFieldOptions()
{
    return [
        1 => [
            'label' => 'Option 1',
            'comment' => 'This is option one'
        ],
        2 => [
            'label' => 'Option 2',
            'comment' => 'This is option two',
            'disabled' => true
        ]
    ];
}

Option group (optgroup) support has been added to dropdowns as a modifier to nested structures (children).

public function getDropdownFieldOptions()
{
    return [
        'Option Group' => [
            'optgroup' => true,
            'children' => [
                1 => 'Option 1',
                2 => 'Option 2',
                // ...
            ]
        ],
    ];
}

Notable Minor Changes

Themes Support Blueprint Directory

Themes now support a blueprints directory, allowing you to introduce theme-specific blueprints. For example in the following file structure.

themes/
    demo/
        blueprints/
            blog-post.yaml    <=== Theme blueprint file

Previously blueprints can reside in the app or plugins directory and are globally available. However, when placing the blueprints in the themes directory they become contextual to that theme. This means that the blueprint navigation is only displayed when the theme is selected in the admin panel. Furthermore, it can be controlled using the site context.

Site Facade Extensibility

The Site facade, that resolves to the System\Classes\SiteManager class, can be now be extended with behaviors and dynamic methods. This allows plugins to incorporate their own interface to this shared service.

\System\Classes\SiteManager::extend(function($manager} {
    $manager->implementClassWith(\App\MyBehavior::class);
});

Cumulative Mode for Checkbox Lists

The checkboxlist field type has introduced a cumulative mode for automatically selecting nested checkboxes when the parent is selected.

permissions:
    type: checkboxlist
    cumulative: true

Hours Only Support for Date Picker

The datepicker form field now supports an hoursOnly mode that simplifies the selection of time. When this mode is enabled, the minute selection is not required.

birth_hour:
    label: Hour Born
    type: datepicker
    mode: time
    hoursOnly: true

This is the end of the document, you may read the announcement blog post or visit the changelog for more information.

comments powered by Disqus