[TYPO3-templavoila] Feature Request: Manage JS/CSS files in TO with class.tslib_pagegen.php

Ron Hall ronslists at busynoggin.com
Sat Jan 16 13:57:47 CET 2010


Hi Fernando,

I looked at your feature request. I could not see how to add a note on in the bug tracker so I will just comment here.

If I understand correctly what you want it is a way to specify CSS and JS files that would be included in the head of the page on the front end when that FCE is placed on the page. 

That would be a good feature but my guess has some special challenges trying to code it. Here are things that I see would need to be addressed with such a feature.

1) Accommodation would need to be made that if an FCE were included more than once on a page that your JS and CSS files would only be included once.
2) If the same JS / CSS files were assigned to two different FCEs and both of those FCEs were included on a page then the JS / CSS files would only be included once on the page.
3) When the JS / CSS files for FCE s were included in the head of the document that they would be listed after any files included by the page template or by headerData of the PAGE object. This is because JS libraries (jQuery, Prototype, etc.) and base CSS is normally included by those methods and your FCE JS would need to be included after those base assets.

Currently you can include header data for FCEs using the "header parts" tab but you run into the issues I mention above.

What I currently do when I have this need is to have the FCE load a unique register value like "includeSWFObject = 1" and I then test for that register value  in  my page object. If the value tests positive then I include it the header code. Admittedly, this is not as nice as having it built into TV but it works now and takes care of all the issues I mentioned above.

Ron



On Jan 8, 2010, at 6:08 AM, Fernando Arconada wrote:

> Hello
> 
> I've just opened a feature request in bugtracker related to manage JS/CSS 
> objects in TO with the improvements of class.tslib_pagegen.php
> 
> I think that this feature could be a big enhancement in templavoila in 
> special for FCE
> 
> http://bugs.typo3.org/view.php?id=13181
> 
> I dont have a patch cause i dont know anything about TV programming
> 
> I have included a mockup of my idea.
> 
> If you like this idea, please: comment, critic and endorse it
> _______________________________________________
> TYPO3-project-templavoila mailing list
> TYPO3-project-templavoila at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-templavoila
> 



More information about the TYPO3-project-templavoila mailing list