SiteIdentityDto
in package
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
$favicon
Favicon; null = static theme files.
private
Asset|null
$favicon
= null
$logo
Logo for a light background (header).
private
Asset|null
$logo
= 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
= ''
$ogImage
Default OG image for pages without their own.
private
Asset|null
$ogImage
= null
$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
getAuthor()
public
getAuthor() : string|null
Return values
string|nullgetFavicon()
public
getFavicon() : Asset|null
Return values
Asset|nullgetLogo()
public
getLogo() : Asset|null
Return values
Asset|nullgetLogoDark()
Dark logo variant; when missing, returns the light one (the footer must not stay empty).
public
getLogoDark() : Asset|null
Return values
Asset|nullgetName()
public
getName() : string
Return values
stringgetOgImage()
public
getOgImage() : Asset|null
Return values
Asset|nullgetTagline()
public
getTagline() : string|null
Return values
string|nullhasLogo()
Does the website have its own logo? Templates choose an image vs. a text wordmark by it.
public
hasLogo() : bool
Return values
boolsetAuthor()
public
setAuthor(string|null $author) : self
Parameters
- $author : string|null
Return values
selfsetFavicon()
public
setFavicon(Asset|null $favicon) : self
Parameters
- $favicon : Asset|null
Return values
selfsetLogo()
public
setLogo(Asset|null $logo) : self
Parameters
- $logo : Asset|null
Return values
selfsetLogoDark()
public
setLogoDark(Asset|null $logoDark) : self
Parameters
- $logoDark : Asset|null
Return values
selfsetName()
public
setName(string $name) : self
Parameters
- $name : string
Return values
selfsetOgImage()
public
setOgImage(Asset|null $ogImage) : self
Parameters
- $ogImage : Asset|null
Return values
selfsetTagline()
public
setTagline(string|null $tagline) : self
Parameters
- $tagline : string|null