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 » Developer » A template for generating .js file
expandshrink

A template for generating .js file

A template for generating .js file

Friday 05 September 2008 11:55:22 am - 2 replies

Hi,

What would be the best technique for creating a template to generate a .js file which has to be included in every page of my site ?

Thanks for your help !

Monday 08 September 2008 5:24:37 pm

Hi,

I would create the javascript code that as to be dynamic on the template itself (inside a <script> tag)

PiR

Tuesday 09 September 2008 9:43:23 am

Or if your not afraid of writing php (doc, settings, code):
http://svn.projects.ez.no/ezcore/trunk/ezcore/doc/ezscript.txt
http://svn.projects.ez.no/ezcore/trunk/ezcore/settings/ezcore.ini
http://svn.projects.ez.no/ezcore/...lasses/ezcoreservercallfunctions.php

However this is only useful if you need to generate a lot of js dynamically, for instance like OE 5.x does with translations:

http://svn.ez.no/svn/extensions/e...ezoe/classes/ezoepackerfunctions.php

So if you have mostly static js, with a couple of dynamic values from template, I would rather split out the static part into a external js file (unless it's small of course) and put the dynamic part in script tags in your pagelayout.

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from