From 463b1970ae425ec7098a7df4199455c02ecc7ce8 Mon Sep 17 00:00:00 2001 From: Matthias Leutenegger <2-mleutenegger@users.noreply.git.syntro.ch> Date: Thu, 30 Sep 2021 18:02:02 +0200 Subject: [PATCH] fix: allow overwriting of the Title field via customised data --- docs/en/01_Title.md | 31 ++++++++++++++++++++----- src/Extensions/SEOSiteTreeExtension.php | 6 +++-- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/docs/en/01_Title.md b/docs/en/01_Title.md index 9d635ab..6f7fad7 100644 --- a/docs/en/01_Title.md +++ b/docs/en/01_Title.md @@ -4,13 +4,32 @@ are vital properties in order to be placed well in a google search. With silverstripe cms, you typically let the framework render the title tag automatically (which corresponds to the page name) or overwrite the default -title in the `Page.ss` template. While both strategies work, we have found that, -especially with page objects, the title tag is often different from the page name. +title in the `Page.ss` template. -We therefore add an additional field to the page object, the `meta title`, which -lets an editor overwrite the title specifically. This is the default setup when -installing this module, but you can change this behaviour by using the following -configuration options: +We have found that, especially with page objects, the title tag is often +different from the page name. Therefore, this module adds an additional field to +the page object, the `meta title`, which lets an editor overwrite the title +specifically. + +While you can let Silverstripe handle the rendering of the title tag using the +`$MetaTags` in the head section, this may become unwieldy when combined with +controllers that try to overwrite the Title, as this Title is then not picked +up by the module. We therefore recommend to render the title in your `Page.ss` +template as follows: + +```html + $MetaTags(false) +