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

eZ Community » Forums » Developer » A template for generating .js file

A template for generating .js file

A template for generating .js file

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


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


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


Tuesday 09 September 2008 9:43:23 am

Or if your not afraid of writing php (doc, settings, code):

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

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.


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

36 542 Users on board!

Forums menu

Proudly Developed with from