Looking at meta tags like Open Graph I'm thinking we might need a more dynamic way to approach adding meta data to content other than just adding one field per meta item to a content type.

For example a product content type has an image, the current approach (to my knowledge) is to enable a meta field that can hold the og:image url (defined by the nodewords/metatags module), and let the user enter the meta data by hand (or use Tokens).
This has its limitations because it depends on that field to contain data, if it's not entered when the node is created then it doesn't contain data.

Wouldn't it be a more flexible approach if we could map meta data from fields + formatters?
In the og:image example selecting the correct field + formatter (Image Style/Cache + 'as url' option) would be enough. This wat the data is not saved in a separate field with the risk of getting out of date and it's easily changeable (selecting a different Image Style / ImageCache would be easy like in Views)
That way we can easily use the node title for og:title for example.
This also holds true for the meta:description, why duplicate the data if I want my meta desctiption the same as the first 120 characters of my node:body? If I do want a different (custom) text, I could create a field, type the meta:description in there, and map it to the proper meta tag.

To my knowledge this kind of functionality is not supported in nodewords/metatags or other meta-like modules, but to me it seems like a great flexible approach.

I'd love to discuss this with others, please feel free to respond.

Comments

Dave Reid’s picture

Frankly this doesn't make a whole lot of sense to me on initial review. We're not going to be using fields in 7.x-1.x. Formatters is over-complicating what we can accomplish with just the token API.

silkogelman’s picture

Status: Active » Closed (works as designed)

My assumption was that the nodewords/metatags modules use (not-on-the-fly) fields to store data, but I seem to be wrong about that.
I'm glad we're not using fields to store the meta data.
Token basically provides the mapping I am suggesting, so I definitely agree (my biggest concern where the fields).
I'm happy to see the Drupal community is already way ahead of my thought process / learning curve :)
My only remaining concern is how to use the title of a referenced node, but I'll figure that out with Tokens.

Thanks for you reply Dave.