This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » eZ Publish 5 Platform » Fallback to legacy module :...
expandshrink

Fallback to legacy module : pagelayout management

Fallback to legacy module : pagelayout management

Monday 15 April 2013 11:25:41 am - 4 replies

Hello,

When we define a twig pagelayout to be used when we fallback in legacy mode (as explained here : https://confluence.ez.no/display/EZP/Legacy+template+fallback), the twig layout is working fine when viewing content. 

The problem is when requesting a module (like user/login). The block "content" in twig layout is not filled in, the layout is rendered giving a module_result as a parameter like you can see here : https://github.com/ezsystems/ezpu...oller/LegacyKernelController.php#L88

Doest it means that for modules we should display the content manually with the variable module_result.content ? 

Why this difference of behaviour ?

 

Thanks

Monday 15 April 2013 12:13:04 pm

The difference here is that if you configure a twig template to render legacy modules, it's rendered as a layout, and as it only concerns legacy, you receive the same variable as before.

Basically, it means that you need to render module_result.content yourself in this template. If your layout is used both for non-legacy and legacy purpose, you can easily check it :

{% block content %}
{% if module_result is defined %}{{ module_result.content }}{% endif %}
{% endblock %}

This was made in order to make layout reusable, even for stuff coming from legacy. Feel free make your layout for legacy modules inherit your base one, defining the content block and displaying module_result.content. This should easily fix the problem happy.gif Emoticon

However I agree that documentation should be more explicit on this point.

Monday 15 April 2013 1:01:08 pm

Ok, no problem if it's normal, except maybe update the doc blunk.gif Emoticon 

I have already made the same code as you propose in the content block and it works great blunk.gif Emoticon 

Thanks !

Tuesday 16 April 2013 10:56:46 am

Just updated the documentation Matthieu happy.gif Emoticon.

Tuesday 16 April 2013 11:08:58 am

Cool, that's much easier to understand happy.gif Emoticon

Cheers

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from