Metadata

5 February 2018 | 33 views | Tags: Documentation

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 theme.html. The default site metadata properties, which are displayed on your home page or when otherwise unspecified, are mainly set from the Tuskfish preferences:

  • meta_title: Site name preference.
  • meta_description: Site description preference.
  • meta_author: Site author / publisher preference.
  • dcterms.rights: Copyright preference.
  • meta_generator: Default value is 'Tuskfish'. You can remove this line from theme.html if you don't like it.
  • meta_robots: Default is 'index,follow' but you can manually override this (see below) to prevent site being indexed.

Overriding metadata

Website- and page-level metadata are handled by the TfishMetadata class. This class is instantiated via tfish_header.php as the global variable $tfish_metadata, which is available in every page load.

You can customise these properties for an individual page simply by overriding the default value in $tfish_metadata. At the bottom of every user-facing Tuskfish script you will find a commented-out list of metadata properties. If you want to change one, just uncomment the relevant line and set the value, or you can set it in your controller logic:

/**
 * Override page template and metadata here (otherwise default site metadata will display).
 */
// $tfish_metadata->title = '';
// $tfish_metadata->description = '';
// $tfish_metadata->author = '';
// $tfish_metadata->copyright = '';
// $tfish_metadata->generator = '';
// $tfish_metadata->seo = '';
// $tfish_metadata->robots = '';

Copyright, all rights reserved.

Related

Tuskfish CMS Developer Guide

This guide will give you an overview of the architecture of Tuskfish CMS, how to write code to perform common operations and how to extend the system to suit yourself. The guide accompanies the Tuskfish API documentation. Keep a copy handy as you read this guide. It is best to review links to the API where provided, as not every detail will be discussed in the text. This is the first version of the guide, so it is still a work in progress.