An example of how to override the default pagelayout template of the default demo-bundle for eZ Publish / eZ Platform

dev-master 2015-05-12 17:13 UTC

This package is auto-updated.

Last update: 2024-05-29 03:27:46 UTC


BCPageLayoutOverrideTestBundle represent a working, ready to use example of all that is required to override the eZDemoBundle pagelayout.html.twig template provided in the default demo front-end website with eZ Publish / eZ Platform

Additional examples

Each of the following changes were made in waves following the initial publishing of this solution to continue to provide further examples how to override the internals of eZDemoBundle.

Review the commit log to learn what was changes to support the following. The commit history diff for each of these additions makes learning what to add yourself very clear.

  • This solution was also extended to provide an example of the code required to customize template override the eZDemoBundle login.html.twig template

  • Later this solution was extended to provide an example of the code required to override content_field templates provided from other bundles, our first example is of the FieldType provided by the NetgenEnhancedSelectionBundle,

  • Later this solution was extended to provide an example of the code required to override the eZDemoBundle page_head_style.html.twig to customize pagelayout background header image (css and bundle image).

Installation via Composer

$ cd /path/to/ezpublish-root-directory; composer.phar require "brookinsconsulting/bcpagelayoutoverridetestbundle" "dev-master";

Uninstall via Composer

$ cd /path/to/ezpublish-root-directory; composer.phar remove brookinsconsulting/bcpagelayoutoverridetestbundle;

Manual Activation

These steps are not required if the bundle is installed via composer.

  • Edit ezpublish/EzPublishKernel.php

  • Add the following line to the use statement blocks (at the bottom of existing list):

    use BrookinsConsulting\BCPageLayoutOverrideTestBundle\BCPageLayoutOverrideTestBundle;

  • Add the following line to the registerBundles function's $bundles array definition (again at the bottom of the existing list)

    , new BCPageLayoutOverrideTestBundle()

  • Here is a more verbose example of what you will see after making the required changes. Please note that you must add a comma after the last bundle definition before you add your own new custom bundle or you will introduce a php syntax error into the file.

    public function registerBundles()
        $bundles = array(
            new FrameworkBundle(),
            // skipping existing bundle activation statements for brevity sake
            new OneupFlysystemBundle(),
            new BCPageLayoutOverrideTestBundle()

If you extend this bundle to provide more features, than more installation steps may be required :)

# Documentation

* [Composer package](

* [License](

* [Forum thread which inspired the pagelayout example](

* [Forum thread which inspired the login example extensions](

* [Related eZ design bundle inheritance documentation](

* [Related Symfony bundle inheritance documentation](

* [Related eZ bundle inheritance issue possible when overriding DemoBundle](

* [Related eZ Authentication documentation](