Path

ez projects / ezjscore / forum / general / standard locations for js/c...


standard locations for js/css generated programatically

You need to be logged in to post messages in the forums. New users may register here.

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Thursday 29 October 2009 12:49:05 pm

Currently:

- ezjscserverfunctions generates javascript code without passing via a template (urgh)

- ezstarrating creates some js files via templates in dir mydesign/templates/ezstarratingtemplate; those have exactly no part of code that are dynamic and do not need to be generated via template anyway

this is imho a bit messy, hard to follow when reverse-engineering the extensions and not 'best practice' that fellow developers should adopt for their code.

Proposal:

- standardize on some directories where dynamic templates and dynamic css are to be found. Eg: mydesign/templates/stylesheets and mydesign/templates/javascript, to be consistent with the non-dynamic naming

- create in those folders the js files that are currently generated by php code ( eg: Y.io.ez )

- move to those folders the starrating templates

Principal Consultant International Business
Member of the Community Project Board

Up

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Monday 02 November 2009 12:42:19 am

As an alternative, I have tried to write templates that include existing files from the design/javascript directory.

It turns out it is possible, by using the 'include' template function using the 'file:' scheme instead of 'design:' for the uri parameter. Alas, this has the inconvenient of not taking into account the design fallback chain - which would be very nice...

This solution also needs to have some {literal} tags at the beginning and end of the js files

Principal Consultant International Business
Member of the Community Project Board

Up

Gaetano Giunta

Member since:
30 November 1999

Posts: 269

Monday 02 November 2009 10:39:27 am

Reply to self: using {include uri=concat('file:', concat('javascript/yui/3.0/build/io/', $arguments.0, '.js')|ezdesign( 'no' )|extract(1))} seems to work, at least in vhost mode.
It needs top be tested in non-vhost settings...

Principal Consultant International Business
Member of the Community Project Board

Up

André R

Member since:
20 August 2005

Posts: 171

Tuesday 03 November 2009 11:28:49 am

Changed ezstarrating (trunk) to load js files instead of templates for javascript code.
Benefit: proper handling of packed cache when source file changes.

--
ar

Up

You need to be logged in to post messages in the forums. New users may register here.