SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class SocialMeta

Management of social meta data tags, such as Facebook OpenGraph and Twitter Cards

Variables

NameVisibilityDescription
$meta_name (static)
Tags of the form <meta name=":key" content=":val">
$meta_property (static)
Tags of the form <meta property=":key" content=":val">

Functions

NameVisibilityDescription
autoGenerateMissingprotected (static)Auto-generate missing OpenGraph and Twitter cards meta data.
getpublic (static) 
hasTitlepublic (static)Has a page title been set?
renderpublic (static)Render the social metadata
setDescriptionpublic (static)Set a short (up to two sentence) description for this page
setImagepublic (static)Set the image for this page - should be unique to this page; not shared across the site
setOpenGraphDatepublic (static)Set a custom OpenGraph date property
setOpenGraphIntegerpublic (static)Set a custom OpenGraph integer property
setOpenGraphStringpublic (static)Set a custom OpenGraph string property
setPageTypepublic (static)The page type, i.e. "og:type" property
setTitlepublic (static)Set a title for this page. Don't include the site name
setTwitterCardTypepublic (static)The twitter card type, i.e. "twitter:card" property
setUrlpublic (static)Set the canonical url for this page

protected autoGenerateMissing

void SocialMeta::autoGenerateMissing ( );

Auto-generate missing OpenGraph and Twitter cards meta data.

public get

array SocialMeta::get ( );

This function does not have a description

public hasTitle

bool SocialMeta::hasTitle ( );

Has a page title been set?

public render

string SocialMeta::render ( );

Render the social metadata

public setDescription

void SocialMeta::setDescription ( string $val );

Set a short (up to two sentence) description for this page

public setImage

void SocialMeta::setImage ( string $url );

Set the image for this page - should be unique to this page; not shared across the site

public setOpenGraphDate

void SocialMeta::setOpenGraphDate ( string $property , DateTime|string $value );

Set a custom OpenGraph date property

public setOpenGraphInteger

void SocialMeta::setOpenGraphInteger ( string $property , int $value );

Set a custom OpenGraph integer property

public setOpenGraphString

void SocialMeta::setOpenGraphString ( string $property , string $value );

Set a custom OpenGraph string property

public setPageType

void SocialMeta::setPageType ( string $val );

The page type, i.e. "og:type" property

Current options are:
  article, book, profile, website, music.song, music.album, music.playlist,
  music.radio_station, video.movie, video.episode, video.tv_show, video.other

public setTitle

void SocialMeta::setTitle ( string $val );

Set a title for this page. Don't include the site name

public setTwitterCardType

void SocialMeta::setTwitterCardType ( string $val );

The twitter card type, i.e. "twitter:card" property

Current options are:
  summary, summary_large_image, app, player
Note that the player card requires approval from Twitter prior to use

public setUrl

void SocialMeta::setUrl ( string $url );

Set the canonical url for this page