prestaconcept / PrestaSitemapBundle

A symfony bundle that provides tools to build a rich application sitemap. The main goals are : simple, no databases, various namespace (eg. google image), respect constraints etc.
MIT License
347 stars 100 forks source link

Help: No URLs were added to sitemap by EventListeners - this may happen when provided section is invalid #325

Closed kostt closed 6 months ago

kostt commented 7 months ago

Help please. I need make dumped sitemaps Symfony 6.3

What i do:

composer require presta/sitemap-bundle "presta/sitemap-bundle": "^3.3"

<?php
// config/bundles.php
return [
    //...
    Presta\SitemapBundle\PrestaSitemapBundle::class => ['all' => true],
];
# config/routes/presta_sitemap.yaml
presta_sitemap:
    resource: "@PrestaSitemapBundle/config/routing.yml"
# config/services.yaml
parameters:
    router.request_context.host:   my-domain.com
    router.request_context.scheme: http

bin/console presta:sitemaps:dump Output: No URLs were added to sitemap by EventListeners - this may happen when provided section is invalid

yann-eugone commented 7 months ago

Hello If you have registered no route to the sitemap (either by adding the route option on static routes, or adding dynamic routes with a listener of yours), this is the expected output

kostt commented 6 months ago

Thank you! I added static routes and a listener for dynamic routes and it worked