2017 © Pedro Peláez
 

library bcpagelayoutoverridetestbundle

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

image

brookinsconsulting/bcpagelayoutoverridetestbundle

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

  • Tuesday, May 12, 2015
  • by brookinsconsulting
  • Repository
  • 3 Watchers
  • 2 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

BCPageLayoutOverrideTestBundle for eZ Publish / eZ Platform

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, (*1)

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., (*2)

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., (*3)

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

  • 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, https://github.com/netgen/NetgenEnhancedSelectionBundle, (*5)

  • 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)., (*6)

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., (*7)

  • Edit ezpublish/EzPublishKernel.php, (*8)

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

    use BrookinsConsulting\BCPageLayoutOverrideTestBundle\BCPageLayoutOverrideTestBundle;, (*10)

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

    , new BCPageLayoutOverrideTestBundle(), (*12)

  • 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., (*13)

    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 :), (*14)

Documentation

The Versions

12/05 2015

dev-master

9999999-dev

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

  Sources   Download

GPL-2.0