Project

General

Profile

Actions

Feature #60723

closed

Make PageRenderer Template Configurable

Added by Philipp Wrann over 10 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-08-01
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
easy
Sprint Focus:

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....


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #11287: Fluid section for header codeClosed2010-12-05

Actions
Related to TYPO3 Core - Feature #78613: Add includeCSSFooter and includeCSSFooterlibs properties to pageClosed2016-11-08

Actions
Actions #1

Updated by Markus Klein over 10 years ago

Where do you need that??

Are style tags allowed to be used outside head?

Actions #2

Updated by Philipp Wrann over 10 years ago

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.

Actions #3

Updated by Markus Klein over 10 years ago

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.

Actions #4

Updated by Philipp Wrann over 10 years ago

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.

Actions #5

Updated by Markus Klein over 10 years ago

  • 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.

Actions #6

Updated by Philipp Wrann about 10 years ago

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.

Actions #7

Updated by Mathias Schreiber almost 10 years ago

  • Target version changed from 7.0 to 7.1 (Cleanup)
Actions #8

Updated by Benni Mack over 9 years ago

  • Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
Actions #9

Updated by Susanne Moog over 9 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #10

Updated by Benni Mack about 9 years ago

  • Target version changed from 7.5 to 7 LTS
Actions #11

Updated by Benni Mack about 9 years ago

  • Target version deleted (7 LTS)
Actions #12

Updated by Riccardo De Contardi almost 9 years ago

at least the javascript async attribute part has been solved in TYPO3 7 (7.1+)

https://docs.typo3.org/typo3cms/extensions/core/latest/Changelog/7.1/Feature-28382-AddAsyncPropertyToJavaScriptFiles.html

I think that this issue could be related: https://forge.typo3.org/issues/11287

Actions #13

Updated by Online Now! GmbH over 8 years ago

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.

Actions #14

Updated by Markus Klein over 8 years ago

  • Status changed from New to Needs Feedback

@Wrann: Can we close this?

Actions #15

Updated by Riccardo De Contardi over 8 years ago

  • 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.

Actions

Also available in: Atom PDF