T3SEO

TYPO3 and SEO since 2011

og:title and og:site_name

Recently I've shown how to use the og:image tag to get images from TYPO3 into the facebook posting preview. Today I want to show og:title and og:site_name and their TYPO3 implementations.

Usage

When an article is liked by a user, his/her friends will see a message which contains the article name as well as the website title. Without Open Graph these informations will be retrieved from the <title> tag and the domain repectively, but a website that used og:title and og:site_name can set the values dedicatedly.

og:title is also used as title for links posted onto a user's wall. Again <title> serves as a fallback here. It might be worth a thought to differ the title for social media usage from the title for Google.

Even if you don't want to set special values with this tags you may want to use them because in the future Facebook and other services will surely involve Open Graph even more into their platforms. By the way, og:title is among the 4 mandatory fields of Open Graph.

TYPO3 implementation

This is a simple example how you can serve these two tags using TYPO3:

page.headerData {
	# og:title
	1036 = TEXT
	1036 {
		data = page:title
		wrap = <meta property="og:title" content="|" />
	}
	# og:site_name
	1037 = TEXT
	1037 {
		data = TSFE:tmpl|sitetitle
		wrap = <meta property="og:site_name" content="|" />
	}
}

This snippet is using the page title as og:title and the Website title from the Root Template as og:site_name which seems pretty straight-forward to me.

Picture Credits: No Name Road by NatalieMaynor (CC BY 2.0)

og:title and og:site_name

    Related Topics

  • Open Graph