Suggestion #6327

page.title

Added by Nathan L over 11 years ago. Updated about 7 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Start date:
2010-02-03
Due date:
% Done:

0%

Estimated time:
Has patch:
Tags:

Description

I thought it might be nice to be able to set a page title.

<f:page.title>{blog.name}</f:page.title>

Arguments:

mode
glue
display

Mode has three potential values:
replace - overwrite the existing page title. This is the default.
append - add the value to the end of the existing title
prepend - add the value to the beginning of the existing title

glue is the string to use if the value is append or prepend.

display has two potential values:
none - meaning the viewHelper renders nothing in the template.
render - means that the tag will render it's children. This way you could use it in the context of an h1 tag like this:

<h1><f:page.title display="render">{blog.title}</f:page.title></h1>


Files

TitleViewHelper.php (2.48 KB) TitleViewHelper.php Nathan L, 2010-02-03 04:58
#1

Updated by Thomas Deinhamer over 11 years ago

Tried it out and works well. Just had to figure out, that
it only works with the default title generation of TYPO3
and this includes an ugly ':' (Doppelpunkt) after the title.

But this viewhelper is a really nice addition!

#2

Updated by Thomas Deinhamer over 11 years ago

Some additional info which I just googled for some time.

To teach 'indexed_search' which title to display in the
Search results list, one can tell it by setting it via:

$GLOBALS['TSFE']->indexedDocTitle = $newTitle;

So in my simple case I just added this little line
to the viewhelper, and now the indexed search will
also display nice titles for pages which act as a
single/details page, displaying product, news, etc. data.

#3

Updated by Bastian Waidelich about 11 years ago

  • Tracker changed from Feature to Suggestion
  • Project changed from TYPO3.Fluid to Fluid - ViewHelper - Incubator
  • Category deleted (ViewHelpers)
#4

Updated by Bastian Waidelich about 11 years ago

  • Subject changed from viewHelper for setting page title from a template to page.title
#5

Updated by Lorenz Ulrich over 9 years ago

+1 for this to go into a Fluid release. Are there any chances if I push this to Gerrit?

#6

Updated by Florian Michel about 7 years ago

This feature is already implemented in FedExt 'VHS', see: http://fluidtypo3.org/viewhelpers/vhs/master/Page/Header/TitleViewHelper.html

Also available in: Atom PDF