Tuskfish API
  • Package
  • Class

Packages

  • content
  • core
  • database
  • installation
  • security
  • user
  • utilities

Classes

  • TfishArticle
  • TfishArticleHandler
  • TfishAudio
  • TfishAudioHandler
  • TfishBlock
  • TfishBlockHandler
  • TfishCollection
  • TfishCollectionHandler
  • TfishContentHandler
  • TfishContentObject
  • TfishDownload
  • TfishDownloadHandler
  • TfishImage
  • TfishImageHandler
  • TfishMetadata
  • TfishRss
  • TfishStatic
  • TfishStaticHandler
  • TfishTag
  • TfishTagHandler
  • TfishTaglink
  • TfishTaglinkHandler
  • TfishTemplate
  • TfishVideo
  • TfishVideoHandler

Class TfishMetadata

Holds page-level metadata and generates pagination controls.

Generates metadata for the page and pagination control. User-facing controller scripts can override the site-level defaults by uncommenting the options at the bottom of each file. A good example of this is when viewing a single content object; if it has the meta_title and meta_description fields set you can assign those to this object in order to customise the page title and description to the object, thereby improving your SEO.

Package: content
Copyright: Simon Wilkinson 2013-2017 (https://tuskfish.biz)
License: GNU General Public License (GPL) V2
Author: Simon Wilkinson simon@isengard.biz
Version: Release: 1.0
Since: 1.0
Located at trust_path/libraries/tuskfish/class/TfishMetadata.php

Methods summary

public
# __construct( TfishPreference $preference )

Initialise object properties and default values.

Initialise object properties and default values.

Parameters

$preference
Instance of TfishPreference, holding site preferences.
public string
# getPaginationControl( integer $count, integer $limit, string $url, integer $start = 0, integer $tag = 0, array $extra_params = array() )

Creates a pagination control designed for use with the Bootstrap framework.

Creates a pagination control designed for use with the Bootstrap framework.

$query is an array of arbitrary query string parameters. Note that these need to be passed in as an array of key => value pairs, and you should build this yourself using known and whitelisted values. Do not pass through random query strings someone gave you on the internetz.

If you want to create pagination controls for other presentation-side libraries add additional methods to this class.

Parameters

$count
Number of content objects (pages) matching these parameters.
$limit
Number of content objects to retrieve in current view.
$url
Target base URL for pagination control links.
$start
Position in result set to retrieve content objects from.
$tag
ID of tag used to filter content.
$extra_params
Query string to be appended to the URLs (control script params).

Returns

string
HTML pagination control.
public string|boolean
# __get( string $property )

Access an existing property and escape it for output to browser.

Access an existing property and escape it for output to browser.

Parameters

$property
Name of property.

Returns

string|boolean

Value of preference escaped for display if set, otherwise false.

Note that the ENT_QUOTES flag must be set on htmlspecialchars() as these properties are used within attributes of meta tags, so a double quote would cause breakage.

public
# __set( string $property, mixed $value )

Set an existing property.

Set an existing property.

Parameters

$property
Name of property.
$value

Value to assign to property.

Note that htmlspecialchars() should use the ENT_QUOTES flag, as most of these values are used within attributes of meta tags, and a double quote would break them.

public boolean
# __isset( string $property )

Intercept isset() calls to correctly read object properties

Intercept isset() calls to correctly read object properties

Parameters

$property
Name of property.

Returns

boolean
True if set, false if not.
public boolean
# __unset( string $property )

Intercept unset() calls to correctly unset object properties

Intercept unset() calls to correctly unset object properties

Parameters

$property
Name of property.

Returns

boolean
True on success, false on failure.

Properties summary

protected array $__data

$__data Array holding values of this object properties, accessed via magic methods.

$__data Array holding values of this object properties, accessed via magic methods.

# array( 'title' => '', 'description' => '', 'author' => '', 'copyright' => '', 'generator' => '', 'seo' => '', 'robots' => '', 'pagination_elements' => '')

Magic properties

public string $title

Meta title of this website.

public string $description

Meta description of this website.

public string $author

Author of this website.

public string $copyright

Copyright notice.

public string $generator

Software system that generated this page.

public string $seo

SEO optimisation string to append to page URL.

public string $robots

Meta instructions to robots.

public integer $pagination_elements

Number of slots in the pagination control.

Tuskfish API API documentation generated by ApiGen