[TYPO3-mvc] collecting (state) info in FLUID
Lienhart Woitok
Lienhart.Woitok at netlogix.de
Thu Feb 4 21:30:16 CET 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hi Martin,
> I'm thinking of JS code that needs to be added before or after the generated HTML snippets. Of
> course I can add as many SCRIPT tags I want to, but just one (or two) will make a shorter and
> possibly faster page. Where to put the data and where to render it? Perhaps with a dumb view hellper
> that simply renders the collected JS code? But at least in the BE I would want to use the JS APIs to
> do that.
> But equally important is the fact that I need to load some JS libs to do anything useful. And maybe
> I need some init code in the HTML header. How would I set that?
I also thought about this a while ago. I don't like to add JS or CSS files to hte generated HTML in the controller, I think this has to be done by fluid. Just think about different output formats, the controller needn't know about them, but a rss feed doesn't need JS, so it must not be included.
Thus a view helper would be needed to do such things, something like <f:document.stylesheet href="{f:uri.ressource ...}" /> or <f:document.script lib="jQuery" >$(function() { console.log("Hello world!"); });</f:document.script>
The <f:document.script /> view helper does also need a optional src attribute and the lib should obviously be optional, too. No content would mean "just load that library or file or both". The <f:document.stylesheet /> could also render its contents, either in <style /> tags or in an external stylesheet file, however the site is set up.
How does this sound to you?
Lienhart
Lienhart Woitok
TYPO3 Entwickler
Telefon: +49 (911) 539909 - 0
E-Mail: Lienhart.Woitok at netlogix.de
- --
netlogix GmbH & Co. KG
Systemhaus | Trainingscenter | Medienagentur
Andernacher Straße 53 | 90411 Nürnberg
Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
E-Mail: mailto:info at netlogix.de | Internet: http://www.netlogix.de/
netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
Umsatzsteuer-Identifikationsnummer: DE 233472254
Geschäftsführer: Stefan Buchta, Matthias Schmidt
-----BEGIN PGP SIGNATURE-----
Version: PGP Universal 2.12.0 (Build 1035)
Charset: Windows-1252
wpUDBQFLay5gWevMF2ftbKMBCEVTA/985ZI4t8br/rRr9fv20yMH72gyyX8POhcF
GJlTUJzFYnjIuwUrfSzwiIJa0ozaBe4hC3/Do379t6JV9QksUSIK7lX1fo8kpfpO
I/h4YGJzg36/AzpHnbHDd78xMuaBkMuAplV/9tLXAyO2tyJ/Q1798yuysk7Bqg2R
mN3apKrCyg==
=S3xi
-----END PGP SIGNATURE-----
More information about the TYPO3-project-typo3v4mvc
mailing list