Chrometoaster\SEO\DataExtensions\MetaDescriptionFallbackExtension
Class MetaDescriptionFallbackExtension
Provide a mechanism to define fallback fields to get relevant content
for meta description header.
A list of fields can be defined and it's followed in that order until some content is found.
Fallback fields can be defined as names of fields, names of methods
or using the dot notation referencing relations or methods.
Examples:
- Description
- Introduction
- Content.Summary
- RelatedPages.First.MetaDescription
Synopsis
class MetaDescriptionFallbackExtension
extends DataExtension
{
- // members
- private static array $fallback_fields = ;
- // methods
- public mixed getGeneralMetaDescription()
- public void MetaTags()
- protected DataObject getCurrentDataObject()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Members
private
- $fallback_fields
—
array
Fallback fields for meta description header
Methods
protected
- getCurrentDataObject() — Get current data object
public
- MetaTags() — Update page meta tags
- getGeneralMetaDescription() — Get MetaDescription for the page/dataobject