[TYPO3-english] Pt #2: How to position a custom page title tag near the top of my head section?

Kevin Mitchell kevin at infielddesign.com
Tue Jul 5 19:17:05 CEST 2011


Wow, thanks for the great response(s). I really appreciate the detailed
info, it's very helpful for a relatively new TYPO3 developer. I'm hoping to
spend some time today working through this. Some of the deeper development
stuff I'm not particularly familiar with yet, so I'm going to have to figure
things out as I go. This is a great start, and I'll be back I'm sure with
questions!

Basically, thanks again for the great information!




On Thu, Jun 30, 2011 at 12:14 AM, Jigal van Hemert <jigal at xs4all.nl> wrote:

> Hi,
>
>
> On 30-6-2011 0:50, Markus Kobligk wrote:
>
>> In line 1191 (refering to 4.5.3) is an XCLASS definition for this class,
>> so you should be able to extend this class via XCLASS and overwrite the
>> function renderContentWithHeader(). There you can change the order of
>>
>
> Instead of an ugly XCLASS there is a nice hook you could use:
> $GLOBALS['TYPO3_CONF_VARS']['**SC_OPTIONS']['t3lib/class.**
> t3lib_pagerenderer.php']['**render-postProcess']
>
> Look at t3lib_PageRenderer::render() for details about this hook. It gives
> you an array with references to all the parts of the page, including the
> headTag property which normally contains '<head>'. There you can add your
> title tag to the very top of the head section.
> (Only add the hook when you're in FE mode...)
>
> Now you just have to see how you use the way TSpagegen::**renderContentWithHeader()
> generates the page title:
>
>        // Title
> $titleTagContent = $GLOBALS['TSFE']->tmpl->**printTitle($GLOBALS['TSFE']->
> **altPageTitle ? $GLOBALS['TSFE']->altPageTitle :
> $GLOBALS['TSFE']->page['title'**], $GLOBALS['TSFE']->config['**config']['noPageTitle'],
> $GLOBALS['TSFE']->config['**config']['pageTitleFirst']);
> if ($GLOBALS['TSFE']->config['**config']['titleTagFunction']) {
>        $titleTagContent = $GLOBALS['TSFE']->cObj->**
> callUserFunction($GLOBALS['**TSFE']->config['config']['**titleTagFunction'],
> array (), $titleTagContent);
> }
>
> if (strlen($titleTagContent) && intval($GLOBALS['TSFE']->**
> config['config']['noPageTitle'**]) !== 2) {
>        $pageRenderer->setTitle($**titleTagContent);
> }
>
> It looks like this code can be used almost anywhere in the FE as long as
> the data in TSFE has already been generated.
>
>
> --
> Kind regards / met vriendelijke groet,
>
> Jigal van Hemert.
>
> ______________________________**_________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/typo3-**english<http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english>
>


More information about the TYPO3-english mailing list