Recent posts

Advanced mail subscription

The CMS TYPO3 extension repository already offers a few plugins that can...
09 January 2012

Convenient In/Out animation using expressions

We recently had an opportunity to make a set of instructional animations...
16 December 2012

Nginx boost extension

Introduction  The Evo_nginx_boost plugin allows us to cache pages...
14 December 2011

Tags

HOW TO: How to set page title in USER_INT extension

There are many discussions at forums concerning setting the title of the page from the USER_INT plug level. The problem is that the USER_INT type extensions are generated every time the page is refreshed after TYPO3 generates the headline of the page containing a tag title. A good example may be the mm_forum, where each thread in a standard installation has the same title, and not the name of the topic as we wish for.

The solution is quite We should add the following code to the code of our USER_INT plug:

CODE:php:
//set page title $GLOBALS['TSFE']->additionalHeaderData['title'] = '<title>'.htmlspecialchars($title).' - my page</title>';

Then in the Typoscript template for the single view page we should add such TS code:

CODE:typoscript:
//set page title
config.noPageTitle = 2

If we look into the cache_pages table now and find the cached single view page contents, we will see that the following marker appears in the headline of the page

<!--HD_d484cf6fcedc0c064492df3e9219ffd1-->

Instead, the USER_INT plug will now generate our title.

Gravatar: Dmitry Dmitry, 26.06.2009 13:15
May be it should looks like:
$GLOBALS['TSFE']-&gt;additionalHeaderData['newTitle'] = ''....'';
Gravatar: Bartosz Aninowski Bartosz Aninowski, 26.06.2009 13:17
As you wish :)
This is just an example from our code.
Gravatar: Dmitry Dmitry, 26.06.2009 13:18
$GLOBALS['TSFE']-&gt;additionalHeaderData['newTitle'] = "&lt;title&gt;"…"&lt;title&gt;";&lt;/title&gt;
Gravatar: Bartosz Aninowski Bartosz Aninowski, 26.06.2009 13:19
You right. My typo. Thanks :)
Gravatar: Bartosz Aninowski Bartosz Aninowski, 30.06.2009 15:37
That wasn't typo :) Tag &lt;title&gt; was not visible in wordpress. It is ok now.&lt;/title&gt;
Add comment

* - required field