Part one of a ten part series: Typo3 SEO
Perhaps the single most important search engine optimization (SEO) best practice is making sure that each page in your site has unique, keyword-targeted search terms in the title tag of the web page’s HTML header. There’s even evidence to suggest that having duplicate titles on many pages severely limits a search engine spider’s ability to rank your pages – since at first glance, all the pages appear similar. On smaller sites, customizing your title tag is not hard to do. However, on a larger site that requires a content management system (CMS), with hundreds or even thousands of pages, this task could prove challenging. Yet, not so with Typo3. Here are a few simple options:
With Typo3, the default page titles are automatically configured to be relevant and unique, according to the following format:
[SITETITLE] : [PAGETITLE]
The only thing you’ll need to do is specify the SITETITLE field, found in the main template information record of your site:
Then, each time you create a page, you’ll be required to specify a PAGETITLE under Edit Page Properties, as such:
Based on the above input, Typo3 will generate the following title tag:
<title>Dawson Interactive: Services</title>
And if I were to add an additional page, with the page title, “About”, Typo3 will generate the following title tag:
<title>Dawson Interactive: About</title>
However, what if on occasion we needed to make the page title more keyword specific without changing the navigational title? Well, one way to do this is to tell Typo3 to use the SUBTITLE field instead. For instance, for our “Services” page above, suppose we preferred the title tag to read “Services and Solutions”. Here’s how to accomplish this:
First, just add the following Typoscript code to your Setup:
### CUSTOM PAGE TITLE
# suppress default title tag
config.noPageTitle = 2
# declare a page header text object
page.headerData.10 = TEXT
# use page subtitle field first; otherwise use page title field
page.headerData.10.field = subtitle // title
# wrap the field with the following
page.headerData.10.wrap = <title>Dawson Interactive: |</title>
Then, customize the “Services” page by modifying the SUBTITLE field under Page Properties:
As a result, Typo3 will generate the following title tag:
<title>Dawson Interactive: Services and Solutions</title>
Also notice that changing the last line of the above Typoscript setup, you can achieve all sorts of custom title tag options. In this case, special characters:
page.headerData.10.wrap = <title>Dawson Interactive » |</title>
Renders:
<title>Dawson Interactive » Services and Solutions</title>
Or, consider changing the order of things:
page.headerData.10.wrap = <title>| at Dawson Interactive</title>
Renders:
<title>Services and Solutions at Dawson Interactive</title>
If you require even greater dynamic customization (with multi-lingual capability), I would recommend trying out the Browser Page Title (browser_page_title) extension. The purpose of this extension is to give you even greater flexibility to control the output of the title tag. You can easily specify a default title with dynamic fields, or use the BROWSER PAGE TITLE field to manually override your default setting. Very handy indeed. Here’s my current setup:
# Title Tags - EXT:browserpagetitle
includeLibs.tx_browserpagetitle =
typo3conf/ext/browser_page_title/class.tx_browserpagetitle.php
config.titleTagFunction = tx_browserpagetitle->getTitle
plugin.browser_page_title {
defaultTitle = Dawson Interactive | {title}
currentTitle = Dawson Interactive |
{tx_browserpagetitle_browser_title}
}
So, for my “Services” page, the default output is:
<title>Dawson Interactive | Services</title>
Yet to customize this as before, in Edit Page Properties, with the Browser Page Title extension installed, you’ll see a new field opened up in the backend, called “Browser Title”. Here, I simply specify what I want the browser title to be. In this case, “Services and Solutions”:
And the output is instead:
<title>Dawson Interactive | Services and Solutions</title>
Very simple. And with just a few small tweaks to the defaultTitle and currentTitle values above, you can achieve many different custom combinations:
static string 1
static string 1 - {dynamic field}
static string 1 - {dynamic field} - static string 2
{dynamic field}
{dynamic field} - static string 2
etc...
The Typo3 framework is so flexible, the possibilities are limitless. So I’ll offer one more. Here’s a handy modification to option 2 (above) which allows you to specify custom page titles based on the level of navigation.
For example, suppose you had a directory site (like www.homeinsurancesites.com), with pages for major cities and states, with the following site structure:
www.homeinsurancesites.com
Alabama
Birmingham
Mobile
Montgomery
Alaska
Anchorage
Fairbanks
Juneau
Etc…
Now suppose you needed to include the city and state name in the title of the respective page. No problem with Typo3. By combining a few conditional statements with the custom header option, we get the following configuration:
### CUSTOM PAGE TITLE
# suppress default title tag
config.noPageTitle = 2
# declare a page header text object
page.headerData.10 = TEXT
# declare that we’ll be inserting custom data
page.headerData.10.insertData=1
# wrap the custom data with the following
page.headerData.10.wrap = <title>|</title>
# if homepage is selected
[treeLevel = 0]
page.headerData.10.value = Home Insurance Sites – Welcome!
# if state level is selected
[treeLevel = 1]
page.headerData.10.value = Homeowners Insurance Sites
in {leveltitle:1}
# if city level is selected
[treeLevel = 2]
page.headerData.10.value = Homeowners Insurance Sites
in {leveltitle:2}, {leveltitle:1}
# ending all conditionals
[END]
This configuration results in the following output:
www.homeinsurancesites.com -> <title>Home Insurance Sites – Welcome!</title>
www.homeinsurancesites.com/alabama -> <title>Home Insurance Sites in Alabama</title>
www.homeinsurancesites.com/alabama/montgomery -> <title> Home Insurance Sites in Montgomery, Alabama</title>
Page URLs - Generating simple, keyword specific URLs with Typo3
Is your CMS SEO-friendly? The following checklist will help you determine the capabilities of your...
TYPO3 would do well to learn from the growing success and core strenghs of Wordpress
If you're looking for a quality and affordable web hosting provider, look no further. Web Hosting...
I am just beginer of typo3 but i don't do anything.Please help me about design typo3 template,how to display page,subpage,where i locate code by which display page subpage.Please help me now.
Great article, thanks.
I'm using the first config under option 2, which is working well, exceptthat I have no space after the colon, so the page titles are looking like:
Dawson Interactive:Services & Solutions
Where might I have gone wrong?
# suppress default title tag
config.noPageTitle = 2
# declare a page header text object
page.headerData.10 = TEXT
# use page subtitle field first; otherwise use page title field
page.headerData.10.field = subtitle // title
# wrap the field with the following
page.headerData.10.wrap = <title>Dawson Solutions: |</title>
Thank you.
Simon
good artilce,thanks
John,
Thank you so much for the help!
I tried setting this on the page, but it looks like I am still missing something. Right now, this is my setting:
### CUSTOM PAGE TITLE
config.noPageTitle = 2
page.headerData.10 = TEXT
page.headerData.10.field = subtitle // title
page.headerData.10.wrap = <title>Site Title - |</title>
[PIDinRootline = 27]
page.headerData.10.field =
[END]
When I view a news story, which displays on the page "Detailed News", it shows "Site Title - " as the page title. So I guess it is still reading the page.headerData.10.wrap line.
Any ideas?
Daniel,
Here's my current setup for my page titles for this site. Hope this helps:
### CONFIG ###
config.noPageTitle = 2
### TITLE ###
10 = TEXT
10.insertData = 1
10.value = Dawson Interactive | {page:subtitle//page:title}
10.override.field = tx_browserpagetitle_browser_title
10.noTrimWrap (
|
<title>|</title>
|
)
### PAGE SPECIFIC SETTINGS ### (insert at bottom of TS setup)
[PIDinRootline = 258]
page.headerData.10.value = {page:title}
page.headerData.20.value =
[END]
First of all, let me say this is a great article!
I am using tt_news and seem to be having a problem with the title's on the news articles.
Just for reference, I am overriding the title with:
page.headerData.10.field = subtitle // title
Previous to doing this my news and blog articles would title the page with their respective titles. Now the title "Detailed News", which is title name of my news display page, is shown instead of the article titles?
Thanks in advance!
Hi Daniel,
Thanks for your comments! If you want your articles page to display the default page title settings, you could try using a conditional to create an exception rule. For instance:
# Article Titles - Page Specific Settings
# (Change PIDinRootline to the PID of your Articles single display page)
[PIDinRootline = 258]
page.headerData.10.field =
[END]
Hope this helps,
John