nystudio107 / craft-seomatic

SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 3. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
https://nystudio107.com/plugins/seomatic
Other
166 stars 71 forks source link

How to Modify ⁠ <lastmod> ⁠ in a generated ⁠ XML-Sitemap.xml ⁠ #1502

Closed Nik-koch-essen closed 3 months ago

Nik-koch-essen commented 3 months ago

After reviewing the plugin documentation, I was unable to identify how to modify the ⁠  ⁠ tag in a generated ⁠ XML-Sitemap.xml ⁠.

I tried using the ⁠ EventHandler ⁠, but it only allows me to add more links, not to modify the existing ones.

Therefore, my question is: how can I achieve this?

Thank you in advance.

khalwat commented 3 months ago

Generally you shouldn't need to do this, because SEOmatic will automatically use the last modified date from the Craft element in question.

What is it you're needing or attempting to do here?

There is the IncludeSitemapEntryEvent event: https://nystudio107.com/docs/seomatic/advanced.html#includesitemapentryevent

...where I suppose you could modify the $event->element->dateUpdated if you wanted to but... unclear what the use-case would be in making this something other than when the Element was last updated in Craft?