Metadata (v2)
11 April 2022 489 views | Documentation v2
Page level metadata
You can customise the site metadata for every individual piece of content, using the fields from Meta Tags section of the content submission form:
- Title: Used to set the <title> tag for the page, which is visible in the top bar of some browsers.
- Description: Used to display the page description in search engine results, limit it to 160 characters or they may crop it.
- SEO: An SEO-friendly string of text that will be appended to the URLs.
Site level metadata
The meta tags of your site are set in the <head> section of layout.html. The default site metadata properties, which are displayed on your home page or when otherwise unspecified, are mainly set from the Tuskfish preferences:
- metaTitle: Site name preference.
- metaDescription: Site description preference.
- metaAuthor: Site author / publisher preference.
- dcterms.rights: Site copyright preference.
Overriding metadata
Website- and page-level metadata are handled by the Metadata class. An instance of this class is passed into the main layout template as the variable $metadata, which is available in every page load. Its properties may be accessed directly.
You can customise these properties for an individual page simply by overriding the default value of the relevant metadata property, calling the relevant setter:
- setSiteName( string $value )
- setTitle( string $value )
- setDescription( string $value )
- setAuthor( string $value )
- setSeo( string $value )
- setRobots( string $value )
- setLanguage( string $value )
Copyright, all rights reserved.