Hi Dynamicweb,
Would it be possible to add an overload or similar option to AddOpenGraphTag, so it can be used as a fallback without overwriting values that have already been set by a module or template?
In Swift’s master template we currently have this section:
Pageview.Meta.AddOpenGraphTag("type", "website");
Pageview.Meta.AddOpenGraphTag("url", Pageview.Meta.Canonical?.ToString());
Pageview.Meta.AddOpenGraphTag("title", Model.Title);
Pageview.Meta.AddOpenGraphTag("description", Model.Description);
This works well for default Open Graph metadata, but it also means that values set earlier by a module or custom template can be overwritten. For example, a product module or detail template may set a more specific og:title or og:description, but the master template then replaces it with the page-level fallback value.
Could an overload be added, for example:
Pageview.Meta.AddOpenGraphTag("title", Model.Title, overwrite: false);
That would allow Swift’s master template to define safe fallback values while still respecting more specific Open Graph tags from modules and templates.
Best regards,
Anders