Live Demo: Try this and other plugins live — no installation, no risk: demo.markus-michalski.net
There is no cache: every call of generate() reads the data anew and writes the files anew.
| Class | Responsibility |
|---|---|
SitemapGeneratorService |
Orchestrates generation, splits at the file limit, writes the index |
AbstractUrlProvider and four providers |
Deliver the URLs per type as a generator, default values for priority and change frequency |
HreflangService |
Reads alternate SEO URLs of all languages via SQL in one block |
XmlWriterService |
Creates urlset and sitemapindex as XML (DOM) |
FileWriterService |
Writes, deletes and lists files in the target directory |
ConfigService |
Reads the plugin settings (MmdSitemap.config.*) per Sales Channel, cleans directory and slug |
GenerateSitemapCommand |
Console command mmd:sitemap:generate |
SitemapGenerationTask and SitemapGenerationTaskHandler |
Scheduled task mmd.sitemap.generation |
ConfigChangeSubscriber |
Transfers a changed interval to the scheduled task |
SitemapController |
Admin API routes for generation and statistics |
MmdSitemap |
Plugin class, cleans up task and settings on uninstall |
The providers are tagged mmd.sitemap.url_provider in the service container and are processed in the order products (100), categories (90), CMS pages (80), manufacturers (70). A custom provider can therefore only be attached through the container, there is no documented extension point.
scheme://host[:port] of the Sales Channel's domain matching the context language, otherwise the first domain.0755. The web server user must be allowed to write to public/<output directory>, otherwise no files are created.--clear and the automatic deletion remove only files matching sitemap*.xml in the respective Sales Channel's target directory.mmd.sitemap.generation and has a default interval of 86,400 seconds.MmdSitemap.config.scheduledTaskInterval changes, the ConfigChangeSubscriber sets the task's interval to the global value of the setting. The task is a single entry overall, which is why only the global value counts.The Vue component mmd-sitemap-generator is embedded in the plugin configuration as the Manual Generation card. It reads the Sales Channel from the parent configuration page, calls the Admin API and shows statistics and result. Texts come from the snippets in German and English.