After a little over three months of hard work, we released the new and improved v3.1 of the Bundles CMS. This post shows some of the most prominent changes and updates for both administrators and developers.

Improvements for website administrators

Administer the robots.txt from the administration interface

Administering the robots.txtThe robots.txt is an important part of optimising the way search engines interact with your website. Until now you needed a developers intervention to change settings in this file. As of this release, there is a configuration option in the settings menu where you can do this yourself. Read more on this new feature in the Cookbook.

Add and delete folders while inside the media-chooser

While editing pages, if you want to add an image, you get a popup that lets you browse the Media section to select an image. It also allows you to upload images directly from the popup. This prevents you getting out of the flow of your editing when you need an image that is not yet uploaded into media. But, it was not possible to add a new folder, forcing you to stop editing and go into Media to create the folder you need to keep it organised. This was annoying and has been corrected.

Uploaded files and images retain their original name and extension

The Media component in the CMS handled uploaded files by replacing the filename by a hash, and by normalising the extension. While this has some technical advantages, it has some bad side effects. Uploaded images will never be found in Google Image search, downloading a PDF like (with the original nice name of annualreport2015.pdf) results in a strangely named file, etc. The hash has been moved to a folder name, and the normalisation has been replaced with a configurable blacklist (nobody should upload an executable .php file...). 

Better descriptions for the different page title options

The Kunstmaan Bundles CMS always had a lot of page title fields, and unfortunately has not always been very clear in their meaning. We tried to remedy this. The first one is "Navigation title", this title is used in the tree, navigations and is the default fallback title for every other title field. Often we want to have a better title on the page itself, something longer, this is the "Page title". If not filled in, it falls back to the Navigation title. The Meta title under SEO is the title that is shown in the browser at the top. Again it falls back to the Navigation title if not filled in.

A complete overhaul of the administration interface, now fully responsive and a lot faster to render

We have always prided ourselves on having the nicest looking and most user friendly administration interface, but over the years requirements have changed. Nobody thought it a common usecase to administer a website on a tablet or smartphone, nowadays, we are dissapointed if it's not mobile enabled. We completely overhauled the entire interface, based on Bootstrap 3. Ty it out in the demo site. (log in using admin / admin) At the same time we redid the demo website frontend, to give a better impression of what you could build with the CMS. This huge job is too extensive to cover completely in this post, so we will follow up with more in depth details soon!

Improvements for developers

Minimum PHP requirements increased to PHP 5.4

PHP 5.3 has been out of maintenance for over 7 months, time to update! Increasing the minimum requirements allows us to improve our code by using all the advanced new features in PHP 5.4 like traits, new array syntax, etc. If you need to keep running on 5.3, please stick to 3.0.x.

Show the classname of a page

While developing or maintaining existing website, as a developer you are often searching for the class that corresponds with your page. If you have the SUPER_ADMIN role, hovering on the pagetitle in the admin interface will show you the class.

A new WYSIWYG formtype

A new wysiwyg form type has been created in the AdminBundle. This makes it possible to use 'wysiwig' in the formbuilder as a type and results in a text area with a wysiwyg editor on top. There are two extra options you can pass as a data attribute:

  • simple: will only render a basic wysiwyg editor
  • full: will render a wysiwyg editor with extra buttons

The wysiwyg formtype also replaces the rich text type when generating a new pagepart using the GeneratorBundle.

You can change all your WYSIWYG field from

$builder->add('name', 'textarea',
    array(
        'attr' => array(
            'rows'  => 5,
            'cols'  => 600,
            'class' => 'js-rich-editor rich-editor'
        )
    )
);

to

$builder->add('name', 'wysiwyg');

Added validation options (mimetypes, min/max width/height for images) to media objects

It is now possible to easily add validation of mimetypes and min/max width and height to media objects. It's both possible manually, and when using the generators.

Generate the default page parts into the default site, to enable modifying them

The PagePartBundle contains a selection of default pageparts. These pageparts are located in your vendors and were not meant to be changed. In practice, we always had to override at least a few of them to match the style or requirements for that website. We now generate copies of the default pageparts when you run the default site generator in your own bundle so you can easily modify these pageparts.

Deprecated the service method in Pages in favour of controller methods

Instead of putting logic in the entity pages (service method), it is now possible to just implement the SlugActionInterface and specify which controller method must be executed. You should remove the service method in your entities and replace them by implementing the SlugActionInterface. Add the method getControllerAction and make it return a callable string.

public function getControllerAction()
{
    return 'Bundle:Controller:service';
}

In your controller just add the serviceAction method, let it handle the logic and set the renderContext in the request attributes.

public function serviceAction(Request $request)
{
    ..logic..
    $context['variable'] = $variable;
    $request->attributes->set('_renderContext',$context);
}

How to upgrade?

Make sure to check out the full changelog and read the upgrade guide thoroughly, then change your composer.json to match the StandardEditon.