[TYPO3-core] RFC: Fix #7657: Add hook to $TSFE->contentStrReplace()

Michael Stucki michael at typo3.org
Sun Mar 2 02:29:03 CET 2008


Thanks Steffen and Olly!

I have committed this change no, the revision is 3338.

Changeset: http://code.typo3.org/v4/changeset/3338

Here's one more little exmple for using this hook:
Conditional CSS is getting more and more difficult to maintain. Imagine how
easy it would be if you could simply wrap your body tag with a class which
defines the browser which is used:

td { border: 1px solid red; }
.ie7 td { border: 1px solid blue; }

Solution: Use this hook and replace a marker inside the body tag with the
output of t3lib_div::getIndpEnv('HTTP_USER_AGENT').

Enjoy! :-)

- michael

Steffen Kamper wrote:

> 
> "Michael Stucki" <michael at typo3.org> schrieb im Newsbeitrag
> news:mailman.1.1203947092.22493.typo3-team-core at lists.netfielders.de...
>> This is a SVN patch request.
>>
>> Problem:
>> This method allows to overwrite markers in a fully generated website
>> after all the caching was already done. So this is very useful for small
>> on-the-fly replacements, for example display the fe_user name, or the
>> time used for page generation.
>>
>> Solution:
>> Add a hook which will allow extensions to use this very useful feature.
>>
>> Comments:
>> $TSFE->contentStrReplace() cannot be used if cacheHeaders are enabled.
>> However, this was already the case before this patch.
>>
>> Bugtracker reference:
>> http://bugs.typo3.org/view.php?id=7657
>>
>> Branches: TYPO3_4-2
>>
>> - michael
>> --
>> Use a newsreader! Check out
>> http://typo3.org/community/mailing-lists/use-a-news-reader/
>>
> 
> A very simple but effective change. I really see many possibilities here
> for using custom Markers in any content and replace them through a hook.
> Big Hands!
> 
> +1 by reading, and though i didn't test it it's obvios that it will work.
> 
> vg  Steffen

-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/


More information about the TYPO3-team-core mailing list