datocms / gatsby-source-datocms

Official GatsbyJS source plugin to pull content from DatoCMS
MIT License
140 stars 50 forks source link

multiple seo fields in a datocms model: automatic generation of seoMetaTags field #173

Closed dw-srohrlack closed 1 year ago

dw-srohrlack commented 2 years ago

When a datocms model contains multiple fields of type "seo-meta-data", the generated "seoMetaTags" field will contain the values of one of those fields - not sure which one is picked. Since a model seems to only ever have exactly one "seoMetaTags" field, it is therefore impossible to distinguish between the seo fields or feed the values of a specific field to HelmetDatoCms.

Example model in datocms:

After sourcing a record of this model with gatsby-source-datocms, the resulting record has a field "seoMetaTags" with these values: title: "world"

Is it possible to get the "seoMetaTags" structure (with tags etc.) for each seo-field individually?

edit As a workaround, I created a modular-content field that contains a block with my second seo field.

stefanoverna commented 2 years ago

Yes, multiple SEO fields are not supported ATM, sorry 😐

— Stefano Verna Founder and CEO DatoCMS

--- original message --- On November 4, 2021 at 5:05 PM GMT+1 @.*** wrote:

When a datocms model contains multiple fields of type "seo-meta-data", the generated "seoMetaTags" field will contain the values of one of those fields - not sure which one is picked.

Since a model seems to only ever have exactly one "seoMetaTags" field, it is therefore impossible to distinguish between the seo fields or feed the values of a specific field to HelmetDatoCms.

Example model in datocms:

field "seo1" of type "seo-meta-tags" with values: title: "hello"

field "seo2" of type "seo-meta-tags" with values: title: "world"

After sourcing a record of this model with gatsby-source-datocms, the resulting record has a field "seoMetaTags" with these values: title: "world"

You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or unsubscribe.

Triage notifications on the go with GitHub Mobile for iOS or Android. --- end of original message ---

dw-srohrlack commented 2 years ago

@stefanoverna Ok. Thanks for the quick reply. Would you accept this as a feature request?

stefanoverna commented 2 years ago

As long as the original signature of what we already offer stays the same :)