CoolCMS API

SiteIdentityDto
in package

FinalYes

Website identity for theme templates: logo, favicon, name, tagline, author.

Filled by SiteIdentityInitTrait on every front end request (the header and <head> always need it), hence a plain DTO without logic and lazy loading: the assets are loaded in one query beforehand.

All images are optional: when the administrator uploads nothing, the template falls back to a text wordmark from the site name, or to the static theme files. Logo, favicon, OG image and author are shared by all languages; the name and tagline already arrive in the page language (site.name.<alias> / site.tagline.<alias> with a fallback to the default language, see LocalizedSettingKey).

Table of Contents

Properties

$author  : string|null
Content of `<meta name="author">`; empty omits the meta tag.
$favicon  : Asset|null
Favicon; null = static theme files.
$logo  : Asset|null
Logo for a light background (header).
$logoDark  : Asset|null
Logo for a dark background (footer); null = `$logo` is used.
$name  : string
Site name (`site.name`, in the page language); also used as the logo alt text.
$ogImage  : Asset|null
Default OG image for pages without their own.
$tagline  : string|null
Tagline under the logo (header and footer); empty turns it off.

Methods

__construct()  : mixed
getAuthor()  : string|null
getFavicon()  : Asset|null
getLogo()  : Asset|null
getLogoDark()  : Asset|null
Dark logo variant; when missing, returns the light one (the footer must not stay empty).
getName()  : string
getOgImage()  : Asset|null
getTagline()  : string|null
hasLogo()  : bool
Does the website have its own logo? Templates choose an image vs. a text wordmark by it.
setAuthor()  : self
setFavicon()  : self
setLogo()  : self
setLogoDark()  : self
setName()  : self
setOgImage()  : self
setTagline()  : self

Properties

$author

Content of `<meta name="author">`; empty omits the meta tag.

private string|null $author = null

$logoDark

Logo for a dark background (footer); null = `$logo` is used.

private Asset|null $logoDark = null

$name

Site name (`site.name`, in the page language); also used as the logo alt text.

private string $name = ''

$tagline

Tagline under the logo (header and footer); empty turns it off.

private string|null $tagline = null

Methods

__construct()

public __construct([string $name = '' ][, string|null $tagline = null ][, string|null $author = null ][, Asset|null $logo = null ][, Asset|null $logoDark = null ][, Asset|null $favicon = null ][, Asset|null $ogImage = null ]) : mixed
Parameters
$name : string = ''
$tagline : string|null = null
$author : string|null = null
$logo : Asset|null = null
$logoDark : Asset|null = null
$favicon : Asset|null = null
$ogImage : Asset|null = null

getAuthor()

public getAuthor() : string|null
Return values
string|null

getLogoDark()

Dark logo variant; when missing, returns the light one (the footer must not stay empty).

public getLogoDark() : Asset|null
Return values
Asset|null

getTagline()

public getTagline() : string|null
Return values
string|null

Does the website have its own logo? Templates choose an image vs. a text wordmark by it.

public hasLogo() : bool
Return values
bool

setAuthor()

public setAuthor(string|null $author) : self
Parameters
$author : string|null
Return values
self

setName()

public setName(string $name) : self
Parameters
$name : string
Return values
self

setTagline()

public setTagline(string|null $tagline) : self
Parameters
$tagline : string|null
Return values
self
On this page

Search results