You are here: Home / Blog / A Title for the Homepage

A Title for the Homepage

Posted by Fulvio Casali at May 21, 2015 06:15 PM |
Filed under:
Over the years, I have been asked a number of times to "fix" the title in the browser window or tab for the homepage. As it turns out, there is a simple solution to this, and it's better than entering a space in the title field.

It's true -- you learn something new every day!

Plone automatically generates the <title> element of every page by concatenating two strings, separated by an &mdash;:

  1. The value of the Title field of the current page
  2. The value of the Site Title on the /@@site-controlpanel.

 

Thus, this page for example has the title:  A Title for the Homepage — Soliton Consulting

But what if you want some page to just show the site title?  Typically, you might want this on the homepage.

 

Simple!  Just give your homepage the same title as the site, and Plone will skip the concatenation business.

 

I stumbled across this when I went to look at the code, expecting to need to customize it.  It's a viewlet after all (plone.htmlhead.title), so that approach is simple enough.  No customization needed!

Filed under: