USER_INT manipulating <title> tag

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

USER_INT manipulating <title> tag

Jonas Dübi-2
Hi

To manipulate <meta> data from a plugin you can overwrite the TSFE->page
fields, which works perfectly if you have a "USER" plugin.

But it does not work if a plugin is USER_INT.

That's because the whole page (including <head>) is generated at the
first call and stored in the cache table. At the next call just the
USER_INT plugins get invoked.

This Cache System is realy great!

But if you have to manipulate the <title> tag within a plugin, it's
difficult.

What do you think? Wouldn't it be best if there was a function to
set/add keywords, description and title from out of a plugin?

Best regards,
Jonas

PS: I would writhe patches for some popular extensions if there would be
one default way to fix this issue.
_______________________________________________
TYPO3-dev mailing list
[hidden email]
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
Reply | Threaded
Open this post in threaded view
|

Re: USER_INT manipulating <title> tag

Bartosz Aninowski-4

>
> What do you think? Wouldn't it be best if there was a function to
> set/add keywords, description and title from out of a plugin?

Hi

TS
config.noPageTitle = 2

PHP
  $GLOBALS['TSFE']->additionalHeaderData['myCustomUserIntTitle'] =
"<title>" .$this->getTitle($newTitle). "</title>";

works with USER and USER_INT plugin

--
Bartosz Aninowski
typo(3)holics
http://techblog.evo.pl
_______________________________________________
TYPO3-dev mailing list
[hidden email]
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
Reply | Threaded
Open this post in threaded view
|

Re: USER_INT manipulating <title> tag

Jonas Dübi-2
Hi Bartosz

Thank you for the answer!

Bartosz Aninowski schrieb:

> TS
> config.noPageTitle = 2
>
> PHP
>  $GLOBALS['TSFE']->additionalHeaderData['myCustomUserIntTitle'] =
> "<title>" .$this->getTitle($newTitle). "</title>";
>
> works with USER and USER_INT plugin
>

That's realy a good idea. There is just the problem, that not all TYPO3
installations use the same integer for adding the regular title to
additonalHeaderData in TypoScript.

But that's easy to solve, by searching the additionalHeaderData for
<title> and replacing it.

What would be cool is a global solution with a clean function which can
be used by every extension and works with all TYPO3 installations ;-)

Is it possible to edit the generated <head> code of the page? With
preg_replace it's possible to change the generated <title> tag so it
always works even if someone uses noPageTitel = 0.

Best regards...
Jonas
_______________________________________________
TYPO3-dev mailing list
[hidden email]
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
Reply | Threaded
Open this post in threaded view
|

Re: USER_INT manipulating <title> tag

Martin Kutschker-7
Jonas Dübi schrieb:

> Hi Bartosz
>
> Thank you for the answer!
>
> Bartosz Aninowski schrieb:
>
>> TS
>> config.noPageTitle = 2
>>
>> PHP
>>  $GLOBALS['TSFE']->additionalHeaderData['myCustomUserIntTitle'] =
>> "<title>" .$this->getTitle($newTitle). "</title>";
>>
>> works with USER and USER_INT plugin
>>
>
> That's realy a good idea. There is just the problem, that not all TYPO3
> installations use the same integer for adding the regular title to
> additonalHeaderData in TypoScript.
>
> But that's easy to solve, by searching the additionalHeaderData for
> <title> and replacing it.
>
> What would be cool is a global solution with a clean function which can
> be used by every extension and works with all TYPO3 installations ;-)


Obvious solution: a standard cObject (just like the one for the body tag).

Masi
_______________________________________________
TYPO3-dev mailing list
[hidden email]
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
Reply | Threaded
Open this post in threaded view
|

Re: USER_INT manipulating <title> tag

Jonas Dübi-2
Martin Kutschker schrieb:
>
> Obvious solution: a standard cObject (just like the one for the body tag).
>
> Masi

But how would you handle the fact, that you have a lot of different
extensions which would like to set their title tag :-)...

Regards, Jonas
_______________________________________________
TYPO3-dev mailing list
[hidden email]
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev