Jump to:

5554 Posts in 1742 Topics by 1227 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Disable Auto-fill of MetaTitle in CMS

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

Page: 1
Go to End
Author Topic: 1155 Views
  • JonoM
    Community Member
    103 Posts

    Disable Auto-fill of MetaTitle in CMS Link to this post


    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>

    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).

  • johnmblack
    Community Member
    61 Posts

    Re: Disable Auto-fill of MetaTitle in CMS Link to this post

    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.

  • martimiz
    Forum Moderator
    1091 Posts

    Re: Disable Auto-fill of MetaTitle in CMS Link to this post

    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...

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.