Version 3.5 of October CMS contains various feature improvements, including site groups, new navigation types and stacked popups.
Table of Contents
- Multisite Groups
- Multisite Mail Settings
- Navigation Sections and Dividers
- Custom Resizer Filenames
- File-based Editor Settings
- AJAX Browser Events
- Notable Minor Changes
Multisite Groups
You can now create site groups by navigating to Settings → Manage Sites → Manage Site Groups. A group selection field should appear for each site when a group is created. The following example shows a grouped site configuration for a website about cats and dogs with two languages for each.
Site Group | Site Name |
---|---|
Dogs | English |
Dogs | French |
Cats | English |
Cats | French |
Grouped sites will only replicate fields within their specific group. For example, if a Tailor blueprint uses the multisite: sync
option, the records will only synchronize across sites in the same group.
See the Multisite documentation to learn more.
Multisite Mail Settings
The mail settings in the backend panel has support for multisite. This means you can use different mail settings based on the selected site, including queued mail. The feature is not enabled by default and can be enabled with the features.backend_mail_setting
configuration found in the config/multisite.php file.
'features' => [
'backend_mail_setting' => false,
],
If you don't have the multisite configuration file, you can create it using this source file found on GitHub.
Navigation Sections and Dividers
The sub-menu navigation in the admin panel now supports various display types using the itemType
property. This allows you to better organize large menu structures, and it works with both horizontal and vertical menus.
Set the type to section
to display a navigation section.
'_section1' => [
'itemType' => 'section',
'label' => 'Advanced',
],
Set the type to ruler
to display a divider.
'_ruler1' => [
'itemType' => 'ruler',
],
Read the Navigation Item Display Types documentation to learn more.
Custom Resizer Filenames
The |resize
Twig filter now supports custom filenames when generating thumbnails. You may use the original filename by passing the true
to filename
option to the resizer.
<img src="{{ 'banner.jpg'|resize(800, 600, { filename: true }) }}" />
The filename
option also supports a custom filename as a string. The filename should not contain an extension since the original one is used.
<img src="{{ 'banner.jpg'|resize(800, 600, { filename: 'my-seo-friendly-name' }) }}" />
Read the Resize Twig filter documentation to learn more.
File-based Editor Settings
The Editor Settings found in the administration panel can now be pre-configured using file-based configuration. The new configuration has been added to the config/editor.php file under the html_defaults
used to hard-code the editor settings.
'html_defaults' => [
'enabled' => false,
'stylesheet_path' => '~/app/assets/css/editor_styles.css',
// ...
'no_wrap_tags' => 'figure, script, style',
'remove_tags' => 'script, style',
// ...
'style_link' => [
'oc-link-green' => 'Green',
'oc-link-strong' => 'Strong',
],
],
AJAX Browser Events
The AJAX framework has been improved to include the ability to dispatch browser events from the server side. This provides a more generic way of handling common response types and logic in your application.
For example, if you want to show an alert that a document has already been updated by another user, you could dispatch an event to the browser.
public function onUpdate()
{
$this->dispatchBrowserEvent('app:stale-document');
}
You can listen to this event in the browser using a generic listener. This example prompts the user before resubmitting the request with a force
flag set.
addEventListener('app:stale-document', function (event) {
if (confirm('Another user has updated this document, proceed?')) {
oc.request(event.target, 'onUpdate', { data: {
force: true
}});
}
});
Read the AJAX handlers documentation to learn more.
Notable Minor Changes
Stacking Popups
When opening several popup windows in succession, the previous windows are now dimmed and slide behind the active window. This makes a friendlier user experience when working with complex forms.
Toggle Switch for Color Mode
The Settings → Customize Backend → Colors section now includes a checkbox to enable a Light Switch. When enabled, this allows users to toggle between Light Mode and Dark Mode in the user navigation.
New Relation Controller Messages
The Relation Controller behavior has added three new language messages for selecting multiple items in the view list. These may need to be updated in your plugins. A selection counter is now appended to the end of the message. For example: Deleted Selected (2).
Message | Default Message |
---|---|
buttonDeleteMany | Delete Selected |
buttonRemoveMany | Remove Selected |
buttonUnlinkMany | Unlink Selected |
New Tailor Prune Command
As a general rule Tailor will never drop table columns and delete content. If a field is removed, the column will be renamed instead of dropped. For example, an old field named content
may appear as x_content_fb418fac
in the database table. Tables for old blueprints are also kept in case they are ever restored.
You can now prune unused database columns with the tailor:prune
command. This command will also drop tables that no longer have an associated blueprint.
New Tailor Propagate Command
When using the multisite: sync
option for Tailor records, you can now retroactively propagate records using the tailor:propagate
command. This command will ensure records exist across all sites.
Disabling Multisite
You may now disable multisite features entirely using the multisite.enabled
configuration item, which is enabled by default. This will remove the menu item, permission and management pages. This setting can be used to lock any existing site definitions.
This is the end of the document, you may read the announcement blog post or visit the changelog for more information.