Overview

Namespaces

  • Charcoal
    • Admin
      • Widget
        • Cms
    • Cms
      • Config
      • Mixin
        • Traits
      • Route
      • Section
      • Service
        • Loader
        • Manager
      • ServiceProvider
      • Support
        • Helpers
        • Interfaces
        • Traits
    • Property

Classes

  • AbstractDocument
  • AbstractEvent
  • AbstractFaq
  • AbstractImage
  • AbstractNews
  • AbstractSection
  • AbstractText
  • AbstractVideo
  • Config
  • Document
  • DocumentCategory
  • EmptySection
  • Event
  • EventCategory
  • ExternalSection
  • Faq
  • FaqCategory
  • Image
  • ImageCategory
  • News
  • NewsCategory
  • Section
  • Tag
  • Text
  • TextCategory
  • Video
  • VideoCategory

Interfaces

  • DocumentInterface
  • EventInterface
  • FaqInterface
  • ImageInterface
  • MetatagInterface
  • NewsInterface
  • SearchableInterface
  • SectionInterface
  • TemplateableInterface
  • TextInterface
  • VideoInterface

Traits

  • MetatagTrait
  • SearchableTrait
  • TemplateableTrait
  • Overview
  • Namespace
  • Class

Trait MetatagTrait

Direct Known Users

Charcoal\Cms\AbstractEvent, Charcoal\Cms\AbstractNews, Charcoal\Cms\AbstractSection

Indirect Known Users

Charcoal\Cms\EmptySection, Charcoal\Cms\Event, Charcoal\Cms\ExternalSection, Charcoal\Cms\News, Charcoal\Cms\Section, Charcoal\Cms\Section\BlocksSection, Charcoal\Cms\Section\ContentSection
Namespace: Charcoal\Cms
Located at Charcoal/Cms/MetatagTrait.php
Methods summary
abstract public string
# canonicalUrl( )

Returns

string
abstract public Charcoal\Translator\Translation|string|null
# defaultMetaTitle( )

Returns

Charcoal\Translator\Translation|string|null
abstract public Charcoal\Translator\Translation|string|null
# defaultMetaDescription( )

Returns

Charcoal\Translator\Translation|string|null
abstract public Charcoal\Translator\Translation|string|null
# defaultMetaImage( )

Returns

Charcoal\Translator\Translation|string|null
public Charcoal\Cms\MetatagTrait
# setMetaTitle( mixed $title )

Parameters

$title
The meta tile (localized).

Returns

Charcoal\Cms\MetatagTrait
public Charcoal\Translator\Translation|string|null
# metaTitle( )

Returns

Charcoal\Translator\Translation|string|null
public Charcoal\Cms\MetatagTrait
# setMetaDescription( mixed $description )

Parameters

$description
The meta description (localized).

Returns

Charcoal\Cms\MetatagTrait
public Charcoal\Translator\Translation|string|null
# metaDescription( )

Returns

Charcoal\Translator\Translation|string|null
public Charcoal\Cms\MetatagTrait
# setMetaImage( mixed $image )

Parameters

$image
The meta image (localized).

Returns

Charcoal\Cms\MetatagTrait
public Charcoal\Translator\Translation|string|null
# metaImage( )

Returns

Charcoal\Translator\Translation|string|null
public Charcoal\Cms\MetatagTrait
# setMetaAuthor( mixed $author )

Parameters

$author
The meta author (localized).

Returns

Charcoal\Cms\MetatagTrait
public Charcoal\Translator\Translation|string|null
# metaAuthor( )

Returns

Charcoal\Translator\Translation|string|null
public string
# metaTags( )

Returns

string
public Charcoal\Cms\MetatagTrait
# setFacebookAppId( string $appId )

Parameters

$appId
The facebook App ID (numeric string).

Returns

Charcoal\Cms\MetatagTrait
public string
# facebookAppId( )

Returns

string
public Charcoal\Cms\MetatagTrait
# setOpengraphTitle( mixed $title )

Parameters

$title
The opengraph title (localized).

Returns

Charcoal\Cms\MetatagTrait
public Charcoal\Translator\Translation|string|null
# opengraphTitle( )

Get the opengraph title.

Get the opengraph title.

If not expilicitely defined, use the meta title as opengraph title.

Returns

Charcoal\Translator\Translation|string|null
public Charcoal\Cms\MetatagTrait
# setOpengraphSiteName( mixed $siteName )

Parameters

$siteName
The site name (localized).

Returns

Charcoal\Cms\MetatagTrait
public Charcoal\Translator\Translation|string|null
# opengraphSiteName( )

Returns

Charcoal\Translator\Translation|string|null
public Charcoal\Cms\MetatagTrait
# setOpengraphDescription( mixed $description )

Parameters

$description
The opengraph description (localized).

Returns

Charcoal\Cms\MetatagTrait
public Charcoal\Translator\Translation|string|null
# opengraphDescription( )

Returns

Charcoal\Translator\Translation|string|null
public Charcoal\Cms\MetatagTrait
# setOpengraphType( string $type )

Parameters

$type
The opengraph type.

Returns

Charcoal\Cms\MetatagTrait
public string
# opengraphType( )

Returns

string
public Charcoal\Cms\MetatagTrait
# setOpengraphImage( mixed $image )

Parameters

$image
The opengraph image (localized).

Returns

Charcoal\Cms\MetatagTrait
public Charcoal\Translator\Translation|string|null
# opengraphImage( )

Returns

Charcoal\Translator\Translation|string|null
public Charcoal\Cms\MetatagTrait
# setOpengraphAuthor( mixed $author )

Parameters

$author
The opengraph author (localized).

Returns

Charcoal\Cms\MetatagTrait
public Charcoal\Translator\Translation|string|null
# opengraphAuthor( )

Returns

Charcoal\Translator\Translation|string|null
public Charcoal\Cms\MetatagTrait
# setOpengraphPulisher( mixed $publisher )

Parameters

$publisher
The opengraph publisher (localized).

Returns

Charcoal\Cms\MetatagTrait
public Charcoal\Translator\Translation|string|null
# opengraphPublisher( )

Returns

Charcoal\Translator\Translation|string|null
public string
# opengraphTags( )

Returns

string
public Charcoal\Cms\MetatagTrait
# generateDefaultMetaTags( )

Generates the default metatags for the current object. Prevents some problem where the defaultMetaTag method content isn't set at the moment of setting the meta. Should be called on preSave and preUpdate of the object.

Generates the default metatags for the current object. Prevents some problem where the defaultMetaTag method content isn't set at the moment of setting the meta. Should be called on preSave and preUpdate of the object.

Returns

Charcoal\Cms\MetatagTrait
$this.
public boolean
# isEmptyMeta( mixed $meta )

Check if the meta is empty. Method exists because at this point we don't really know what's in the meta. Possible param type: - [ lang => value, lang => value ] - Translation - null

Check if the meta is empty. Method exists because at this point we don't really know what's in the meta. Possible param type: - [ lang => value, lang => value ] - Translation - null

Parameters

$meta
Current meta value.

Returns

boolean
Empty or not.
abstract protected Charcoal\Translator\Translator
# translator( )

Returns

Charcoal\Translator\Translator
Properties summary
protected Charcoal\Translator\Translation|string|null $metaTitle
#
protected Charcoal\Translator\Translation|string|null $metaDescription
#
protected Charcoal\Translator\Translation|string|null $metaImage
#
protected Charcoal\Translator\Translation|string|null $metaAuthor
#
protected string $facebookAppId

$facebookAppId

$facebookAppId

#
protected Charcoal\Translator\Translation|string|null $opengraphTitle
#
protected Charcoal\Translator\Translation|string|null $opengraphSiteName
#
protected Charcoal\Translator\Translation|string|null $opengraphDescription
#
protected string $opengraphType
#
protected Charcoal\Translator\Translation|string|null $opengraphImage
#
protected Charcoal\Translator\Translation|string|null $opengraphAuthor
#
protected Charcoal\Translator\Translation|string|null $opengraphPublisher
#
API documentation generated by ApiGen