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 » ez_legacy_render_js() does not load...
expandshrink

ez_legacy_render_js() does not load ezjscore javascripts

ez_legacy_render_js() does not load ezjscore javascripts

Thursday 25 September 2014 10:28:59 am - 5 replies

Hi all,

I'm trying to load ezjscore base files to have access to $.ez calls with no luck. Currently I'm in a node full view on symfony, that renders a node embed view that is loaded via legacy and using a legacy tpl.

In the legacy tpl I have the usual {ezscript_require()}. Also, in the header twig template added {{ez_legacy_render_js()}} so I've supposed that this will load the ezjscore required javascripts.

Nothing happens. Javascripts are not loaded, thus I'm getting errors of $.ez not defined.

Any idea out there?

Many thanks!!

Sunday 28 September 2014 8:26:06 pm

Hi Xavi. 

Maybe jQuery is loaded twice or something? If you have something like DemoBundle maybe legacy is trying to load jquery again and that may lead to errors.

This is still a know issue.

Let me know if this is what is happening

Monday 29 September 2014 9:19:35 am

Thanks for your reply  Carlos.

In fact, I've managed that I have only a ezscript_require, and without a ezscript_load seems that anything is loaded from ezjscore. I've solved it including from the corresponding twig template a legacy tpl with corresponding ezscript_load.

Not sure if we are doing something in a wrong way, because in my case ez_legacy_render_js() apparently does nothing. I believe that caused because I'm not executing a legacy module, instead I'm executing main content module from SF stack, but inside a location view there is embedded another location view, in this case rendered from legacy stack.

Should ez_legacy_render_js() render javascript files included from tpl via ezscript_require() ? I'm a bit confused.

Thank you!

Monday 29 September 2014 5:24:11 pm

and do you have a dedicate twig (pagelayout_legacy.html.twig) ? 

from my understanding, ez_legacy_render_js should work in that case. maybe a gist can help. or maybe we can discuss it by email if you want blunk.gif Emoticon

Wednesday 01 October 2014 10:49:11 am

I believe that in this case it is not applicable, cause I'm on a full view in the SF stack. I think that I'm starting to understand the behaviour.

These twig helpers are only applicable when rendering a full view of a legacy module, thus, as I'm rendering the view from the legacy stack BUT in a subrequest via render ez_content:viewLocation.

To be more clear, I've a full view of a folder, and inside it, a render of a children. The main full view rendered in SF stack, and the children rendered in legacy stack.

Please correct me if I'm wrong.

Wednesday 01 October 2014 1:31:13 pm

Yes you're right Xavier. 

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from