Feature #60723
closed
Make PageRenderer Template Configurable
Added by Philipp Wrann over 10 years ago.
Updated over 8 years ago.
Description
It should be possible to configure the PageRenderer.html template.
I want to move the css includes to the page end (from head) and cant find a possibility for that.
I cant hook in at the right moment to call setTemplateFile, i cant overrule the Class in extbase config, i cant exchange the class with autoloader...
You could:
add a hook at the right moment where you can modify the PageRenderer itself
make the templateFile a static property that i could change in localconf
make the rendering process use a fluid view i could exchange
...
Or maybe add 2 new PAGE settings
- page.includeCSSFooter
- page.includeCSSFooterLib
Or add a setting
- config.moveCSSToFooter
i would prefer the last one because it would be the most secure way thinking about updates and stuff....
Where do you need that??
Are style tags allowed to be used outside head?
Yes of course its allowed, future specifications also allow them to be scoped within the context they appear.
A link outside of the head can make a difference in first-page-load delay. They final result will not load faster but all in all the response seems to be faster.
Its not a big difference but it would be nice to have the possiblity.
You could seperate your styles in 2 different sections, one layout css and one optional with font file definitions, icon sets, libraries like jquery ui and stuff.
Then put the important stuff in the head and the lower priority stuff to the bottom.
That way it would make a big difference on the first hit.
Alright. Can you please post some links to the mentioned specifications, since I only found HTML5 specs saying that <style> must only be used in metadata context and that is <head> only.
http://html5doctor.com/the-scoped-attribute/
http://caniuse.com/style-scoped
It seems this is only related to inline styles.
I came to this because when using the google page speed tool it suggests to move links outside of the head (like we do it with scripts). When i wanted to implement that feature in my typo3 distribution extension i found out its not possible to modify the PageRenderer View.
- Target version changed from next-patchlevel to 7.0
Interesting, I never had that with page speed. Is this new?
Generally, the scoped CSS stuff is supported by almost no browser, so I will not spend time on this feature, sorry.
Feel free to push a patch though.
It would generally be nice to have more influence on the generation of those script/css lines. I also miss the possibility of adding async to javascripts.
- Target version changed from 7.0 to 7.1 (Cleanup)
- Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
- Target version changed from 7.4 (Backend) to 7.5
- Target version changed from 7.5 to 7 LTS
- Target version deleted (
7 LTS)
I guess this ticket can be closed because it is probably based on a wrong/incomplete translation of the google documentation. In the german version of the following page:
https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery
Google suggests to add the css files after the html tag. This shouldnt be working and it will also make your html invalid. If you switch the translation of this page to english, you can see that there is a javascript code in the footer which injects link tags with css files in the head. This is a significant detail and can be done with all current TYPO3 versions.
Besides there is already a property in the typoscript config object ( config.pageRendererTemplateFile ) to set a html template for the page renderer. The default template is located in EXT:core/Resources/Private/Templates/PageRenderer.html.
- Status changed from New to Needs Feedback
@Wrann: Can we close this?
- Status changed from Needs Feedback to Closed
I close this because, as stated on comment 13, it is currently possible to configure the page renderer via config.pageRendererTemplateFile
since version 6.2.
If you think that this is the wrong decision or that there is something left to be done, please open a new ticket with a reference to this one. Thank you.
Also available in: Atom
PDF