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 » ezpublish.legacy empty even in legacy...
expandshrink

ezpublish.legacy empty even in legacy stack

ezpublish.legacy empty even in legacy stack

Wednesday 19 March 2014 10:45:48 am - 3 replies

Hello,

I'd like to know how the legacy stack works. What I mean is referred to this confluence page https://confluence.ez.no/display/EZP/Twig+Helper on Legacy section.

The page says:

"ezpublish.legacy is only available when viewing content in legacy fallback"

I'm not sure I really got when ezpublish.legacy property is available. In my specific situation I need to load configured asset in registration page (mysite.com/user/register) in order to activate eZ Image Editor tool. 

I'm trying to load css and js files as in the documentation (https://confluence.ez.no/display/EZP/Legacy+template+fallback#Legacytemplatefallback-Assets) but both variables are empty even in this page. Of course the template loaded is user/registration.tpl so no Twig template is loaded. 

In one of my own controllers I tried to retrieve the setting from ini file:

$jsList = $legacyResolver->getParameter( 'JavaScriptSettings.FrontendJavaScriptList', 'design' );

and the Js list is right filled. 

How can I load the right asset in this page?

UPDATE:

I have the ezpublish_legacy.default.module_default_layout setted to something like the following:

ezpublish_legacy.default.module_default_layout: 'MyOwnBundle::pagelayout_legacy.html.twig'

Modified on Wednesday 19 March 2014 10:50:19 am by Simone D'Amico

Wednesday 19 March 2014 2:29:04 pm

Hi

ezpublish.legacy helper is only filled when viewing content through the legacy kernel (e.g. when you don't have a twig template for it). It won't work for modules.

Wednesday 19 March 2014 2:44:49 pm

Hi Simone

why not pack these JS/CSS in the pagelayout and take advantage of assetic?

If you use these JS/CSS only for user/register, you may consider two different pagelayouts and address them in parameters.yml separately.

Cheers,
Donat

Friday 04 April 2014 5:46:04 pm

Thank you Jérome and Donat.

@Donat:

It could be a good idea but the problem is that some of these js files requires YUI3 with many of its libraries and I can't figure out a fast way to include all js dependencies.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from