Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Disable Auto-fill of MetaTitle in CMS


Go to End


3 Posts   1856 Views

Avatar
JonoM

Community Member, 130 Posts

15 October 2010 at 6:01pm

Hello,

It seems like it is best/common practice to display page titles in templates like so (taken from black candy).

<title><% if MetaTitle %>$MetaTitle<% else %>$Title<% end_if %> &raquo; $SiteConfig.Title</title>
$MetaTags(false)

Assumingly the idea here is that the page Title (called Page name in the CMS) will be used unless a MetaTitle has been specifically provided to override the Title (for SEO reasons or what have you). This way there's no need to enter the title in two places unless you want finer control. It makes sense to me and I always use this convention.

Because I have the template set up as so it frustrates me that the CMS automatically fills in the MetaTitle field for new pages, which can lead to pages having completely wrong page titles down the track as unless it is cleared it will always use the override.

With the template set up as above the auto-fill function is redundant - so I was wondering if there is a way to disable this, perhaps by a setting in _config.php?

If not, could it be added to a future release? It drives me nuts! I think a config option would be okay but for me it would make even more sense to completely remove the auto-complete and change the $MetaTags function to use the logic above when rendering a title meta tag (MetaTitle if available else Title).

Avatar
johnmblack

Community Member, 62 Posts

31 August 2011 at 6:02am

Edited: 31/08/2011 6:03am

I completely agree with this, and actually it's not just inconvenient -- it has created huge problems for us. We spread out the work of creating many, many pages (almost over a hundred) over a team of people. What many of them did is created one page for a section, tweaked all the settings, then Duplicated the rest, changing only the stuff in the Content page. Which *you would think* would be a great time-saving way to do this.

The end result was that 90% of the pages created had the MetaTitle *duplicated* from the original. We didn't discover this until 2 months after the site went live. Our SEO was all screwed up and we couldn't figure out why, and one of the reasons turned out to be that all the pages with duplicate Meta Titles were *rejected*.

Now we have to go and touch all the pages and recheck the meta titles.

I'm going to create an alternate custom field for this and stop using the built-in MetaTitle field, to prevent this from happening again. Please, someone tell me there is a way to turn off the autofill so I don't have to. :-)

Avatar
martimiz

Forum Moderator, 1391 Posts

31 August 2011 at 8:09am

I don't think it can be turned off officially.

The functionality responsible can be found in sapphire/javascript/UpdateURL.js around line 26. I don't like hacking core, but if you need to...