[TYPO3-core] RFC #16580: Feature: Implement render-postProcess Hook

Fabien Udriot fudriot at omic.ch
Fri Dec 17 18:40:54 CET 2010


+ 1 for testing and reading.

I have attached a v3 that cleans up the code a little bit further.

FYI bellow is the testing I did:

----------------------------
1. create file typo3conf/user_pagerenderer.php with


function user_pagerenderer($params, $pObj) {
	$params['cssFiles'] = 'put someting else to show a difference';
}

2. add following line in typo3conf/localconf.php

require_once('typo3conf/user_pagerenderer.php');
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_pagerenderer.php']['render-postProcess'][] 
= 'user_pagerenderer';


3. load the FE to see the message in the HTML <header>.




On 14/12/10 6:07 PM, Jeff Segars wrote:
> On 12/13/10 3:50 AM, Morton Jonuschat wrote:
>> On 2010-12-08 08:24:34 +0100, Ernesto Baschny [cron IT] said:
>>
>>> Jeff Segars schrieb am 07.12.2010 19:44:
>>>> On 12/2/10 3:24 AM, Morton Jonuschat wrote:
>>>>> This is an SVN patch request.
>>>>>
>>>>> Type: Feature
>>>>>
>>>>> Bugtracker references:
>>>>> http://bugs.typo3.org/view.php?id=16580
>>>>>
>>>>> Branches:
>>>>> TYPO3_4-4 & trunk
>>>>>
>>>>> Problem:
>>>>> Postprocessing and/or modification of page content, CSS, JS and misc.
>>>>> HTML tags used for page generation is only doable by XCLASSing
>>>>> t3lib_pageRenderer. This solution is not very elegant since
>>>>> XCLASSing is
>>>>> limited to a single class extendig the functionality. Due to this I
>>>>> propose to implement a hook comparable to render-preProcess that has
>>>>> access to some (or even all) relevant variables/content right before
>>>>> the
>>>>> markerArray gets assigned.
>>>>>
>>>>> Solution:
>>>>> The attached patch implements above mentioned hook with access to each
>>>>> and every variable used in the process of generating the content for
>>>>> the
>>>>> marker array.
>>>>>
>>>>> With kind regards,
>>>>>
>>>>> Morton Jonuschat
>>>>> Buttgereit und Heidenreich GmbH Agentur für Kommunikationsdesign
>>>>> www.gute-botschafter.de <http://www.gute-botschafter.de/>
>>>>>
>>>>>
>>>>
>>>> Hey Morton,
>>>> Thanks for your patch! Since this is a new hook, we can't add it to the
>>>> 4.4 branch. We've already hit the feature freeze for 4.5, but let's see
>>>> if Steffen and Ernesto are OK with hook additions :)
>>>>
>>>> Overall, +1 on reading and I agree its nice to have the symmetry of pre
>>>> and post processing via hook. I think it would make sense to use the
>>>> exact same params array in pre and post processing. Your new array is
>>>> more complete, so it could be defined once at the top of render() and
>>>> used for both hooks. Does that sound ok to you?
>>>
>>> I am ok with such new hooks in 4.5 still.
>>>
>>> But I cannot see that working on some of the params because for example
>>> $this->jsFiles is not really used anymore after that hook: a local
>>> variable $jsFiles is.
>>>
>>> So you should change the $params to include all the variables that are
>>> really used *after* that postProcessing happens.
>>>
>>> Cheers,
>>> Ernesto
>>
>> Hi,
>>
>> i've updated the bug report in the bugtracker and created a new patch
>> which corrected the mentioned variable names. The patch is against the
>> current trunk version from this morning.
>>
>> Cheers,
>> Morton
>
> Thanks for the update Morton! +1 on reading v2 of the patch.
>
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: render-postProcess-v3.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101217/7e538043/attachment.txt>


More information about the TYPO3-team-core mailing list