[TYPO3-dev] Adding meta tags in Extension?

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Fri Sep 1 13:44:09 CEST 2006


Martin Kutschker schrieb:
> Elmar Hinz schrieb:
> 
>> Martin Kutschker wrote:
>>
>>> Heiner Lamprecht schrieb:
>>>
>>>> On Thursday 31 August 2006 13:55, Dmitry Dulepov wrote:
>>>>
>>>>> Hi!
>>>>>
>>>>> Heiner Lamprecht wrote:
>>>>>
>>>>>> I'm looking for a possibility to add meta tags to a page from
>>>>>> within my extension.  I'm writing an extension that displays
>>>>>> images on a page and would like to add the keywords from the
>>>>>> DAM backend to the meta tags of that page.
>>>>>
>>>>>
>>>>> $GLOBALS['TSFE']->config['config']['additionalHeaders']
>>>>>
>>>>> Read about config.additionalHeaders format in TSRef.
>>>>
>>>>
>>>> The documentation talks about HTTP-headers, like redirection, not
>>>> about meta tags in the HTML head.
>>>>
>>>> I tried to write the keywords in $GLOBALS['TSFE']->page['keywords']. 
>>>> But it seems, that the output is already created, before my extension
>>>> adds the new keywords. ;-(
>>>
>>>
>>> Beware that you cannot change the HTML header from a USER_INT object.
>>> THe reason is that during the time the USER_INT code is executed the
>>> HTML header is already generated and cached.
>>>
>>> Masi
>>
>>
>>
>> Hi Masi,
>>
>> this technic you find in xajax_tutor. Although your theory is fine it
>> seems to work within USER_INT. Maybe the head is not cached. Just a
>> guess. :-)
> 
> 
> I never could change the title of a page (but ypu may set a separate 
> title for the indexed search). So I assumed no header data can be 
> changed. But I may be wrong.

What definitely dows not work from a USER_INT is this:

$GLOBALS['TSFE']->JSeventFuncCalls['onload']['xxx'] = 'alert("my code");';

I don't really understand the code in pagegen that stores some (but not 
all?) data back into $TSFE. To me it seems that at least part of the header 
is generated once and stored in the cache. So none or only other parts may 
be changed from a USER_INT.

Masi




More information about the TYPO3-dev mailing list