eZ Community » Forums » eZ Publish 5 Platform » How to change default layout in...
expandshrink

How to change default layout in 2014.11 version?

How to change default layout in 2014.11 version?

Monday 05 January 2015 3:32:42 pm - 9 replies

Hi all,

I'm totally new in eZPublish and i'm struggling with changing default page layout...

I've got my bundle, registered properly in kernel.

What should i do next, to switch the default layout template file from eZDemoBundle::pagelayout.html.twig to my own?

 

Monday 05 January 2015 4:20:56 pm

You have it in config/parameters.yml:

ezpublish_legacy.default.view_default_layout: 'eZDemoBundle::pagelayout.html.twig' 

 

But also you can define a pagelayout template per siteaccess or siteaccess group like that:

ezpublish_legacy.blog.view_default_layout: BlogBundle::pagelayout.html.twig

ezpublish_legacy.website_group.view_default_layout: WebsiteGroupBundle::pagelayout.html.twig

Monday 05 January 2015 4:36:43 pm

Quote from Andrey Astakhov :

You have it in config/parameters.yml:

ezpublish_legacy.default.view_default_layout: 'eZDemoBundle::pagelayout.html.twig' 

 

But also you can define a pagelayout template per siteaccess or siteaccess group like that:

ezpublish_legacy.blog.view_default_layout: BlogBundle::pagelayout.html.twig

ezpublish_legacy.website_group.view_default_layout: WebsiteGroupBundle::pagelayout.html.twig

Is there a possibility, that it does'nt work?

I found this solutions earlier, but nothing happened. And the same this time.

What kinda information should i provide, to find what's wrong?

Monday 05 January 2015 4:41:51 pm

The very first is to be sure that you have cleared a cache.

Then you can open ez publish tab in the webprofiler and check loaded templates.

Could you also show a part of your configuration file with these parameters?

Modified on Monday 05 January 2015 4:59:49 pm by Andrey Astakhov

Monday 05 January 2015 5:03:30 pm

Cache cleared.

In EzPublish Tab in webprofiler are loaded only eZDemoBundle and EzPublishLegacyBundle templates.

This is my config/parameters.yml file contents:

parameters:

secret: XYZ

locale_fallback: en

mailer_transport: smtp

mailer_user: null

mailer_password: null

ezpublish_legacy.default.view_default_layout: 'MyBundle::pagelayout.html.twig'

Modified on Monday 05 January 2015 5:06:50 pm by Marek Skopowski

Monday 05 January 2015 5:29:34 pm

It means you are on the right way but maybe something obvious is forgotten. I can suggest to check that you bundle is enabled in EzPublishKernel.php.

Did you check log files in ezpublish/logs folder? Is there something interesting about this problem?

Monday 05 January 2015 5:50:12 pm

Ok, i think that is something obvious that i missed. Thanks anyway. I'll give you an update when i figure it out.

Thursday 08 January 2015 10:38:16 am

ezpublish/config/config.yml:

assetic.bundles: [MyBundle]

 

That's the solution. 

Summary:

- remove eZDemoBundle registration in kernel

- remove ezpublish/config/routing.yml _ezPublishDemoRoutes section

- make sure to leave only your bundle in assetic.bundles section in ezpublish/config/config.yml

I hope i didn't forget anything.

Enjoy.

Friday 29 April 2016 11:51:17 am

Hi Marek,

Could you explain how to remove eZDemoBundle registration in kernel? thanks happy.gif Emoticon

Friday 29 April 2016 12:16:14 pm

@Julien,

ezpublish/EzPublishKernel.php. Comment line "new EzSystemsDemoBundle()" in registerBundles method.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from