eZ Community » Forums » eZ Publish 5 Platform » Bestpractice regarding pagelayout...
expandshrink

Bestpractice regarding pagelayout when upgrading from 4.x to 5.x

Bestpractice regarding pagelayout when upgrading from 4.x to 5.x

Friday 17 January 2014 4:44:07 pm - 4 replies

Hello.

I'm currently upgrading a site from 4.6 to 5.2. It's a multisite with tons of siteaccesses.

What is best practice regarding the pagelayout? Is there some way I can point the frontend siteaccesses directly to the legacy pagelayouts, or should I rewrite the pagelayout from eztpl to twig?

I defined the following in parameters.yml:

ezpublish_legacy.nor.view_default_layout: 'MyBundle::legacy.html.twig'

I have also defined ezpublish.system.<siteaccess>.content.tree_root.location_id in ezpubish.yml.

I've tried following the documentation but it's not really clear to me regarding the usage of content blocks when this only provides me with the module content (not head, menues, and all the other logic in my legacy pagelayout).

What is the best way to proceed?

Friday 17 January 2014 4:54:39 pm

Hi Harald

The best of course is to rewrite the layout in Twig. If you don't want to repeat your default layout configuration, you can consider using a siteaccess group :

ezpublish_legacy.my_siteaccess_group.view_default_layout: 'MyBundle::legacy.html.twig'

The same can go with the root location ID if needed.

Consider also using an extended layout for legacy modules, so you don't have to do the work twice when changing the design of your pagelayout.

And last but not least, you can retrieve information when viewing content from legacy fallback (displayed in ViewController but templated handled by legacy kernel) by using the Twig helper.

Friday 17 January 2014 5:22:13 pm

Hello Jerome, and thank you for your quick reply.

I was looking into the Twig helper to pass module_result into the legacytemplate. But as I couldn't find an identical collection I saw it best to rewrite the pagelayout into twig, insted of making changes in the current legacy pagelayout. Regardless, is it possible to make a legacypagelayout work (for a specific siteaccess) without too much hassle?

Thanks again, I'll go ahead and rewrite the default siteaccess pagelayout to twig. I won't use more than a milisecond considering whether Im extending the layout or not. I love twig's blocks blunk.gif Emoticon 

Friday 17 January 2014 5:29:30 pm

Hi

It's not possible to re-use your legacy pagealayout unless you use legacy mode, which is strongly not recommended.

I'm happy you love Twig happy.gif Emoticon

Saturday 18 January 2014 11:21:39 am

Extending twig templates might be helpful too in this case.

Simple example here: http://www.netgenlabs.com/Blog/eZ...age-or-any-other-pagelayout-override

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from