Open brynwhyman opened 4 years ago
We had this in core in 3.0, and it was removed (I can’t remember why, but it still seems short-sighted to me!), so I copied the functionality out into a module: https://github.com/kinglozzer/silverstripe-metatitle. I’d be in favour of adding this back in to the CMS module - it doesn’t make much sense IMO to include the option of custom meta tags but not include a simple meta title field.
Agree with @kinglozzer use his module on every site
@kinglozzer I think the functionality in your module as it stands would make a great addition to the CMS module.
I've removed this way back in the day because it didn't strike me as a baseline CMS feature, and can easily be handled in a module. In hindsight, I might have underestimated how many authors and site owners value this feature for SEO purposes. Note that you can already distinguish the navigation title (often shorter, shown in menus) from the page title (often longer, shown in page body, browser title, search engines, CMS page tree).
Could you describe the use case for a third way to set the title? Note that Google recommends using <title>
, and even in its create good titles advice only references <meta description>
rather than <meta title>
Could you describe the use case for a third way to set the title?
It’s usually for SEO - not necessarily ranking these days, but often as a one-line sales pitch - where the content you want to use wouldn’t make sense as an h1. E.g. bigfork.co.uk has a <title>
of Bigfork - Digital Marketing & Web Design Agency - Norwich & Cambridge, and that’s what shows up in Google search results, but the h1 on the page is different. It’s probably possible to achieve the same with hidden h1s, but I think that’s generally frowned upon
Note that Google recommends using
, and even in its create good titles advice only references \<meta description> rather than \<meta title>
Yep, the module also uses the title tag - no idea why it’s called a “meta title” when it isn’t a meta tag but that’s what I’ve always been told!
lol OK that got me confused, I thought it was setting <meta name="title">
rather than <title>
. Yep that makes sense. Another use case I've seen is temporary title changes, e.g. "NHS London: Vaccines - Vaccine delivery expected on 10th of Jan".
The problem with re-adding this to core is that lots of templates would've been built without the required conditional. It's still in place in the simple theme and cwp theme, but that doesn't mean much.
I can't think of a way to reintroduce this into core without misleading some users about the new feature: It might not work in their specific template. And if we make it an opt-in by developers after checking their "theme compatibility", we might as well ask them to install that module.
Also, how would this new core feature behave when a field with the same name has already been added? Does the ORM handle this gracefully?
Yeah perhaps we’d be better off leaving it as a module for now and re-adding it to the next major version instead?
We use a module, usually @kinglozzer's one for 95% of projects (thanks Loz). If it's not able to be added to the core until a major, what about adding it as a suggested composer package for the time being?
what about adding it as a suggested composer package for the time being
Dunno, we'll easily end up with dozens of "suggested" packages. I'd rather do this via docs, which enables Silverstripe devs to discover modules and add them to their own "project starter kits". The module is on page five of the most popular modules on the addons site, so I'd argue it's reasonably discoverable.
Loz, Christopher, maybe you want to publish your own "project starter kit"? We could add a "discover" section to the addons site which links off to these repos? Also, either of you keen to write a quick blog post about SEO? It's been a while: https://www.silverstripe.org/blog/tag/seo
So in conclusion, there's many ways to ensure cms users get a great experience, other than the sledge hammer of "include it in core" :)
So in conclusion, there's many ways to ensure cms users get a great experience, other than the sledge hammer of "include it in core" :)
In my opinion it still belongs in core just as much as MetaDescription
/ExtraMeta
, so my preference would be to re-add it for 5.0. I don’t feel too strongly about it though - we do already have our own starter kit that includes it - I just thought I’d chime in on this issue 😄
I'm OK for this to be re-added to 5.x, although there's not much drive at the moment to push new things into that branch and stabilise it. Christopher and Loz, can either of you send a pull request to recipe/cms
as well as the relevant themes?
With the desire to have an accurate page title for SEO purposes, it's pretty common to want to set a meta title tag that's different to the page title that's saved in the CMS.
Currently, the framework sets the title tag to inherit the page title. I think that's a good default as it requires no further action by the content author but for many, modifying this shouldn't require a Developer to set up a custom field (IMO).
It would be nice for the CMS to have a dedicated field to add a meta title tag on the base page. If a value was entered here it would override the default page title value.
Docs on how this currently works here: https://docs.silverstripe.org/en/4/developer_guides/templates/common_variables/#meta-tags