Cms\Classes\Page\HasTranslatableBag
Overview
HasTranslatableBag resolves translated template properties from the translatable component
Protected Properties
protected mixed $translatableBagCache
translatableBagCache store for the getTranslatableBag method.
Public Methods
public applyTranslatableContext()
public applyTranslatableContext(
System\Models\SiteDefinition|null $site = null
): void
applyTranslatableContext overrides page attributes with translated values for a site.
public getTranslatableBag()
public getTranslatableBag(): Cms\Components\TranslatableBag
getTranslatableBag returns the configured translatable component.
public getTranslatableUrl()
public getTranslatableUrl(
System\Models\SiteDefinition|null $site = null
): string|null
getTranslatableUrl returns the translated URL pattern for a site, if available.
public getTranslatableValue()
public getTranslatableValue(
string $name,
System\Models\SiteDefinition|null $site = null
): string|null
getTranslatableValue returns a translated property value for a site, if available. The name avoids the get*Attribute convention since translatable is a real attribute.
Protected Methods
protected isTranslatableEnabled()
protected isTranslatableEnabled(): bool
isTranslatableEnabled checks the multisite page translation feature is active.