After months of development, we’re glad to finally make the first prerelease of ContentBlocks 1.3 available - just in time for the holidays! This is a pre-release, so we do not recommend testing it out on your production site. If you find any issues, please let us know by posting here on the forum or by sending an email to support@modmore.com.
So what’s new?
This is a big release, with many new features (17!), improvements (9!) and even some bug fixes (5!). I’ll highlight some of my favorites, but the full changelog is included at the bottom of this post for your entertainment.
Ability to insert layouts anywhere
Previously, to add a new layout at the top or in the middle of the canvas, you would need to add it to the bottom and then move it up - a painful and boring process. Now, there’s a helpful “Add Layout” button injected in the top right that allows you to insert it at any position easily.
More than one row per layout
If you add more than 100% (one row) of columns to a layout, that could have tragic results as every column would get the same height assigned. In 1.3 we’ve fixed that, so you can now have multiple rows of content in a single layout.
Context-aware settings
For finer control over the system settings included in ContentBlocks, we’ve made them context aware so you can override them per context too.
A lot more path placeholders
Brought in sync with Redactor, you can now use all resource fields and several other placeholders (including the ultimate parent alias) as path placeholders for upload paths on Image, Gallery and File input types.
Image fields automatically create thumbnails
For performance reasons you can now set image fields to automatically create a thumbnail for the uploaded/chosen image.
Improved portability with relative URLs
Images and galleries will now store image urls relative to the site root (assets/uploads/image.png
instead of /subfolder/assets/uploads/image.png
). This makes ContentBlocks content more portable for subfolder installations, as there are no more hardcoded references to your site’s base url.
Repeaters now use real fields in the group
This one’s kinda technical and under the hood. Basically in the old situation, repeaters would store the group configuration as simple JSON, using that to mock the fields when it is added to the canvas. While functional, this meant some features didn’t work quite as well (for example uploading images would always go to the default upload path rather than the path defined in the properties, and certain input types would simply refuse to work because of the lack of a field ID). In ContentBlocks 1.3, the repeater groups are created as real fields (cbField) objects. This means those more advanced use cases will now also work, and that the interface has changed slightly.
When upgrading to ContentBlocks 1.3, the installer will automatically attempt to migrate your existing repeaters to this new way. Before doing that, it will write an export of all your fields to core/export/ just to make sure.
Powered by Alpacka
Part of the enhancements in this release are brought to you by Alpacka: a new composer package we’ve developed that contains utilities like the context-aware settings, path placeholders and common instantiating logic. The Alpacka library allows us to standardise part of our common code into a standalone library.
ContentBlocks 1.3 is the first release to be built with it, but our other extras will follow soon in their next releases. Alpacka is open source, so you could use it for your Extras as well. We’ll talk about this more soon.
More information
For more information about ContentBlocks, please visit modmore.com/cb.
Installing the 1.3 Prerelease
To install the prerelease, head over to the API Keys page in your Account and find the API Key that you used for the site you want to install the prerelease on. Next, in the Channels column, click on the Pre-releases channel to enable it.
After that, go to Package Management on your site and check for updates (or download a new license). If you’re not offered the update, please let us know via support@modmore.com including the domain name you’re trying to update on.
Full Changelog for ContentBlocks 1.3.0-rc1
New features:
- New “Add Layout” button to insert layouts at any point in the canvas (#103)
- Allow more than one row of columns per layout (#310)
- Click a layout title in the Canvas to give it a different title on that specific row (#272)
- Add [[+width]] and [[+height]] placeholders to image and gallery inputs (#274)
- Repeater input now also has a “Add Item” button at the top for inserting new items before existing ones (#242)
- Add expandAllLayouts and collapseAllLayouts methods to the js class
- Parse Resource tags (e.g. [[*pagetitle]]) on save and rebuild (#252)
- Make all settings context-aware for context-specific overrides
- Upload path placeholders now include all resource fields, tvs (with tv. prefix), some settings and (ultimate) parent id and alias (#196, #247)
- Allow template properties to grow in height for all input types
- Add checkbox and radio setting types for fields and layouts
- Image fields can now automatically create thumbnails for improved back-end performance (#257)
- Image and gallery fields will now store the urls as relative urls when possible, increasing portability (#286)
- Add ContentBlocks_RebuildContent, AfterRebuildContent and RenderContent system events (#132, #243, #283)
- Add option to set a minimum number of repeater items (#308)
- Add single-field, single-layout, and single-template exporting (#255)
- Add .contentblocks-field-richtext class to richtext field wrapper template
Improvements:
- Better keyboard accessibility through additional focus styles
- Make sure the default value field for settings is a textarea instead of textfield (#256)
- Make the rebuild time guesstimate slightly more accurate
- Add ability to set the number of decimals on cbFileFormatSize [#320]
- Add ability to set an inner limit and/or offset for repeaters in cbGetFieldContent (#330, thanks Thomas Jakobi!)
- Filter out revisions from Extras.io Preview/Workflow extras in the link input [#317]
- Autogrow TinyRTE to make sure it shows all the content without scrollbars [#341]
- Make use of the modmore/Alpacka composer package for standard, shared functionality.
- Make sure all vtab panels can scroll if their content is too large to fit
Fixed:
- Fix loading of field properties within a repeater group [#315]
- Fix usage of [[+idx]] within cbGetFieldContent
- Fix table input going nuts with more than 10 rows (thanks Luk!) [#277]
- Fix table context menu hiding behind other elements [#339]
- Fix CSS conflict with SimpleCart causing scroll issues in vtabs