[TYPO3-mvc] set Browser title from extBase extension.

Nathan Lenz typo3 at k9tfk.com
Thu Jan 21 20:54:21 CET 2010


A common thing I need to do when building extensions that show lots of
something is setting the browser title.

It would be easy to set in the action of a controller.


However, would there be any value in allowing the template developer a
chance to do it?  If so, here is a simple proposal:


<f:page.title
	mode (overwrite,insert,append)
	glue (what to implode it by)
	pageTitleProperty ('title' by default)>


This would overwrite the existing $GLOBALS['TSFE']->page['title'].

<f:page.title mode="overwrite">{blog.name} - {post.name}</f:page.title>


This would insert the contents into the page title with a " - " in
between if there is an existing value.

<f:page.title mode="insert" glue=" - ">{blog.name}<f:/page.title>
<f:page.title mode="append" glue=" | ">{post.name}<f:/page.title>


<f:page.title mode="overwrite"
pageTitleProperty="tx_browserpagetitle_browser_title">{blog.name}<f:/page.title>

This would allow you to use a different element within the TSFE->page
array, useful if you have an extension.


It should automatically strip out any special characters as best as
possible unless Typo3 already does that.

Subsequent calls will either overwrite or add too the title.  The last
one in the template would get the last word.





More information about the TYPO3-project-typo3v4mvc mailing list