brookinsconsulting/bcpagelayoutoverridetestbundle

如何覆盖默认的eZ Publish / eZ Platform演示-bundle的默认pagelayout模板的示例

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

This package is auto-updated.

Last update: 2024-09-29 04:08:43 UTC


README

BCPageLayoutOverrideTestBundle代表了一个可用的、准备好使用的示例,涵盖了覆盖eZDemoBundle pagelayout.html.twig模板所需的所有内容,该模板包含在默认的eZ Publish / eZ Platform演示前端网站中。

其他示例

以下每个更改都是在最初发布此解决方案后的一波波进行的,以继续提供更多覆盖eZDemoBundle内部结构的示例。

查看提交日志,了解对以下内容的更改。每个添加的提交的历史差异都清楚地说明了需要添加的内容。

  • 此解决方案也被扩展,以提供一个示例代码,用于自定义覆盖eZDemoBundle login.html.twig模板。

  • 稍后,此解决方案被扩展,以提供一个示例代码,用于覆盖来自其他bundle的内容字段模板,我们的第一个示例是NetgenEnhancedSelectionBundle提供的字段类型,https://github.com/netgen/NetgenEnhancedSelectionBundle

  • 稍后,此解决方案被扩展以提供一个示例代码,用于覆盖eZDemoBundle page_head_style.html.twig,以自定义pagelayout背景头部图像(CSS和bundle图像)。

通过Composer安装

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

通过Composer卸载

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

手动激活

如果通过composer安装了bundle,则不需要这些步骤。

  • 编辑ezpublish/EzPublishKernel.php

  • 将以下行添加到使用语句块中(在现有列表的底部)

    use BrookinsConsulting\BCPageLayoutOverrideTestBundle\BCPageLayoutOverrideTestBundle;

  • 将以下行添加到registerBundles函数的$bundles数组定义中(再次在现有列表的底部)

    , new BCPageLayoutOverrideTestBundle()

  • 以下是一个更详细的示例,说明在做出必要的更改后您将看到的内容。请注意,在添加自己的新自定义bundle之前,您必须在最后一个bundle定义之后添加逗号,否则您将在文件中引入PHP语法错误。

    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](https://packagist.org.cn/packages/brookinsconsulting/bcpagelayoutoverridetestbundle)

* [License](https://github.com/brookinsconsulting/bcpagelayoutoverridetestbundle/blob/master/LICENSE)

* [Forum thread which inspired the pagelayout example](http://share.ez.no/forums/ez-publish-5-platform/best-way-to-use-override-system-in-ez-publish-5#comment86463)

* [Forum thread which inspired the login example extensions](http://share.ez.no/forums/developer/how-to-add-a-login-box-to-the-frontpage-ezpublish-5.4)

* [Related eZ design bundle inheritance documentation](https://doc.ez.no/display/EZP/How+to+create+a+new+design+using+Bundle+Inheritance)

* [Related Symfony bundle inheritance documentation](https://symfony.com.cn/doc/current/cookbook/bundles/inheritance.html)

* [Related eZ bundle inheritance issue possible when overriding DemoBundle](https://jira.ez.no/browse/EZP-23575)

* [Related eZ Authentication documentation](https://doc.ez.no/display/EZP/Authentication#Authentication-AuthenticationusingSymfonySecuritycomponent)