2

I think I know the answer for this (multiple) but I just wanted to see how others are doing it?

Right now I have a single default meta field type that I add to most of my sections. At this stage I've got the advanced 'Meta Details' turned off but we're starting to need to make per section tweaks and I'm looking at enabling this.

Given we want finite control (and better sectional specific fall backs if the meta information isn't supplied) I'm now realising that most people probably have a meta field for each section?

If I do migrate from a single to multiple (~30 sections atm) there's not a simple way to migrate the existing meta data is there?

3

tldr; Use as many Element Metadata fields as you need unique mappings between your Elements and your metadata. You can replace an existing Element Metadata field with a new one without losing data, but it will depend on the field settings of the old and new field.

A single Element Metadata field as a starting point

A single Element Metadata field across all sections is a good place to start. It reduces project overhead for getting things setup and provides a starting point with more comprehensive metadata than most sites. I typically recommend creating two custom fields: Summary and Feature Image and then mapping the single Element Metadata field to those common fields: Title, Summary, and Feature Image across all sections.

As you describe, in some cases you begin to need more specific metadata. This is a good signal for when to start considering multiple Element Metadata fields. Often, a section may have custom fields that are better suited for its metadata, and creating an Element Metadata field specific to that section will give you the flexibility to customize that sections metadata in a unique way.

Updating Element Metadata fields

If you're transitioning from an existing Element Metadata field to a new one, it's good to think about it like a migration and any SEO implications that may be affected if your metadata changes. Depending on how you set things up initially, and on what you are trying to achieve, there are a few considerations.

Dynamic Metadata

The easiest way to manage metadata is to have it dynamically generated from other content fields already present in your element field layout. If you take this approach, admins are not manually entering any metadata and all metadata is being generated based on the pattern that you set it up with.

If you update the patterns of your dynamic metadata in the Element Metadata field or add a new Element Metadata field to a channel to replace an old one, you don't need to migrate any metadata because the new field will generate the metadata dynamically for you. When you change the settings in an Element Metadata field or resave a Field Layout, Sprout SEO triggers a ResaveElements task (just like Craft does when you change a URL Format in your Section settings) and resaves all Elements that are related to that field which also resaves all the metadata based on the pattern you have in the field settings.

While you don't have to take any action on your website, note that in this scenario, if you change the metadata pattern, you are potentially changing the metadata on all of your pages. Make sure the changes are what you want and test and monitor those changes accordingly for your needs.

Custom Metadata

If you've enabled admins to edit metadata directly via Editable Meta Fields or the Meta Details overrides, the data should persist if you change to a new Element Metadata field. Sprout SEO only supports one Element Metadata field per Field Layout. When you update a field layout and replace an old Element Metadata field with a new one, as far as your Element is concerned, the only thing that changed is the Element Metadata field settings.

Again, be sure to test any changes you make and confirm the data is still there. It is possible to change the settings in a way that would overwrite some metadata when elements are resaved. But, if you keep the same custom metadata Editable Fields or Meta Details fields enabled, the existing data should persist.

|improve this answer|||||
  • Awesome write up Ben - really appreciate the detailed response. All makes sense. Was going to email you directly about this but I'm glad it's all here for everyone to see. – Dane Thomas Sep 1 '17 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.