[Typo3-dev] Please review this patch to disable generation of empty title tags.

Kasper Skårhøj kasper2004 at typo3.com
Mon Nov 22 16:31:08 CET 2004


Michael Stucki or Ingmar can commit this for you.

There is a bug though; The title should be checked with 

if( strlen($titleTagContent) ) {

... otherwise the page title could be zero and not displayed which would
be wrong.

- kasper


On Mon, 2004-11-22 at 16:10, Hannes Schmidt wrote:
> Maybe someone could review and apply the following patch to the 3.7.0
> version of class.tslib_pagegen.php. It disables the emission of an empty
> title tag. This would be useful in order to suppress Typo3 default title tag
> in case the user's template generates the title as described on
> http://www.hannesschmidt.de/drupal/node/7.
> 
> The patch suppresses the emission of a title tag if the tag's content would
> be empty. Once this patch is included in the next version of Typo3, the user
> can disable the generated title tag by setting config.noPageTitle to 1 and
> config.siteTitle to an empty string.
> 
> -- Hannes
> 
> --- class.tslib_pagegen.php.old Mon Nov 22 15:03:47 2004
> +++ class.tslib_pagegen.php     Mon Nov 22 14:56:21 2004
> @@ -605,8 +605,10 @@
>                         $titleTagContent =
> $GLOBALS['TSFE']->cObj->callUserFunction($GLOBALS['TSFE']->config['config'][
> 'titleTagFunction'], array(), $titleTagContent);
>                 }
> 
> -               $GLOBALS['TSFE']->content.='
> +               if( $titleTagContent ) {
> +                       $GLOBALS['TSFE']->content.='
>         <title>'.htmlspecialchars($titleTagContent).'</title>';
> +               }
>                 $GLOBALS['TSFE']->content.='
>         <meta name="generator" content="TYPO3 3.7 CMS" />';
> 
> 
> 
> _______________________________________________
> Typo3-dev mailing list
> Typo3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
-- 
- kasper

----------------
Man søger fred i rigdom, glans og ære
og tænker: Hvad kan hjertet mer begære?
men dybt derinde bor den samme længsel,
og hjertet græder i sit gyldne fængsel.






More information about the TYPO3-dev mailing list