Closed pculka closed 5 months ago
Hi @pculka
Maybe the doc is not clear enough, or maybe the behaviour is not what you are expecting, but the URL property is expected NULL
when the event is dispatched.
You will have access to the route name and the routing sitemap
options.
And if you set that URL, it will be what you set that will be added.
Originally, this was created to handle translated routes, and this is why we are not creating the UrlConcrete
You can have a look to https://github.com/prestaconcept/PrestaSitemapBundle/blob/v3.3.1/src/EventListener/RouteAnnotationEventListener.php for an example of how you can use this event.
Hope that helps
Not a bug, and no answer received, closing
PHP version(s) affected: 8.2
Package version(s) affected: 3.3.1
Description
I'm trying to use
SitemapAddUrlEvent
to decorate my Urls (as per docblock I should subcribe if I want to decorate) Though the $event->getUrl() is empty, meaning it is impossible to decorate the URL... AlsoHow to reproduce
create a simple event listener:
Also, there is no UrlContainerInterface like in SitemapPopulateEvent, meaning there is no way to add the decorated URL to the "pool" for dumping...
Possible Solution
Additional Context