[TYPO3-dev] 4.3 PageIncludes

Ernesto Baschny [cron IT] ernst at cron-it.de
Wed Oct 28 20:18:38 CET 2009


Steffen Kamper schrieb:

>> Some things were unclear to me, so I figure out it will also be unclear
>> to other people too. So Steffen, could you please elaborate a more about
>> these things in the pending docu page? Tt would be very much appreciated:

> i take the opportunity to explain it here as it's more public than wiki,
> will add some notes in wiki later.

>> First about:
>>
>> - includeJS (we always had that)
>> - includeJSlibs
>> - includeJSFooterlibs
>> - includeFooterJS
>>
>> 1) includeJSlibs (new) vs includeJS. What's the difference? In the
>> documentation they are described in the exact same manner. What's the
>> different of a "non-lib" with a "lib"?
>>
> 
> In general there is no difference, but they are rendered to different
> markers. In practise you always have some "libs" and scripts depend on
> libs, so the main difference is that libs are rendered on top of
> scripts. So you don't have to worry like before where you had to use
> high numbers (headerData.100000) to be sure it will be rendered after
> other scripts.
> 
>> 2) why does one want to do a "config.moveJsFromHeaderToFooter"? The
>> documentation should explain a bit more when it makes sense and when not.
>>
> 
> I think it's best described here:
> http://developer.yahoo.com/performance/rules.html
> 
> In short: if you place JS below content, the browser renders the visible
> content first and then start loading JS, so you don't have to wait for
> JS be loaded before seeing content. There are other performance reason
> described in details with above link.
> 
> 
>> 3) are includeFooterJS + includeJSFooterlibs affected by the new
>> "config.moveJsFromHeaderToFooter"? Will they come before or after the
>> "header js moved to the footer"?
>>
> 
> If you look to the markers, the sequence of the markers will not change.
> Without setting (short)
> ###JSLIBS###
> ###JSFILES###
> ###CONTENT###
> ###JSFOOTERLIBS###
> ###JSFOOTERFILES###
> and with the setting:
> ###CONTENT###
> ###JSLIBS###
> ###JSFILES###
> ###JSFOOTERLIBS###
> ###JSFOOTERFILES###
> 
> so you don't have to worry about loading sequence.
> 
>> 4) new "footerData", maybe we could add the use-case of plugins that in
>> the past added themselves to "page.999" or something, which is then no
>> longer required. page.footerData.extKey < plugin.blabla is much nicer.
>>
> absolutely. There are many usecases like google analytics, stats etc.
> 
>> 5) the "pageRenderTemplateFile" property is poorly described. What is
>> this template? How would an user know what the "pageRender class" is?
>> What does the "default template" do and when and why would one want to
>> adapt it?
>>
> core use this template for page render:
> typo3/sysext/cms/tslib/templates/tslib_page_frontend.html
> 
> If you need special ordering or other tiny stuff, just copy this file to
> fileadmin/templates, change to your need and set with this TS setting.
> 
>>
>> And then some general questions about these new flags, as I
>> unfortunately haven't really followed that discussion:
>>
>> a) why is the naming of the last too not consistent? One is JSFooter,
>> the other one is FooterJS (flipped around)
>>
> mabye unlucky. I think it's not too late to adjust them as we are still
> in Beta.
> 
>> b) why do we need such a difference anyway? Couldn't "footer=1" be just
>> a flag for the regular includeJS?
>>
> i had this in the beginning and i recognized disadvantages. Mostly it's
> because of clean separation and better clarity of stucture in your
> templates. Then it's rendered to different/corresponding markers.
> 
>> [1] http://wiki.typo3.org/index.php/Pending_Documentation
> 
> ever good to post this link ;)
> 
> One additional answer for the question of Tobias
> 
>> Can you explain what "forceOnTop = 0/1" means/makes?
> 
> this is an additional flag inside one "Block". Setting means you add the
> file to the beginning of this block, without it's added at the end.
> 
> Hope explanation was sufficient and understandable.

Thanks for the explanations, Steffen! Indeed the majority of my
questions were answered by the fact that "order does matter". So
mentioning the order or even how the "default template" looks like in
the documentation (or as a image) would for sure make a lots of stuff
clearer to people.


Cheers,
Ernesto




More information about the TYPO3-dev mailing list