CoolCMS API

OgDataInitTrait

Table of Contents

Properties

$ogData  : OgDataDTO|null

Methods

initializeOgData()  : void
ogData()  : OgDataDTO
Returns the page OG data; filled by `initializeOgData()` in startup, an empty DTO before that.
prepareOgData()  : OgDataDTO
buildDefaultOgImage()  : OgImageDTO|null
Builds the default OG image from the site identity (admin, settings, site identity).

Properties

Methods

ogData()

Returns the page OG data; filled by `initializeOgData()` in startup, an empty DTO before that.

protected ogData() : OgDataDTO
Return values
OgDataDTO

buildDefaultOgImage()

Builds the default OG image from the site identity (admin, settings, site identity).

private buildDefaultOgImage(string $alt) : OgImageDTO|null

Default only: detail pages override the image with their own (OgDataTrait::prepareOgDataForDetail()), after this call. Without a configured image og:image is not rendered at all.

Parameters
$alt : string
Return values
OgImageDTO|null
On this page

Search results