The "concrete/jobs/generate_sitemap.php" file is the file/job to generate the sitemap. This dispatches the event "on_sitemap_xml_ready" (line 82). Now what I've done is, added an event listener in my package's controller.php file as followed:
Events::addListener('on_sitemap_xml_ready', function ($event) {
/* @var $event GenericEvent */
if ($event->hasArgument('xmlDoc')) {
$xmlDoc = $event->getArgument('xmlDoc');
$changeFrequency = 'weekly';
$priority = 0.8;
$xmlNode = $xmlDoc->addChild('url');
$xmlNode->addChild('loc', 'the-location');
$xmlNode->addChild('lastmod', 'last-modified-over here');
$xmlNode->addChild('changefreq', empty($changeFrequency) ? Config::get('concrete.sitemap_xml.frequency') : $changeFrequency);
$xmlNode->addChild('priority', is_numeric($priority) ? $priority : Config::get('concrete.sitemap_xml.priority'));
}
});
What I need to know know is, how can I actually change the already set argument ($xmlDoc), so this node I created and added, actually gets generated with the sitemap too? Because now, my code only will execute, but will not change the argument ($xmlDoc is defined in generate_sitemap.php and will not be retrieved with my cahnges). So my page will not get added to sitemap.xml. What should I do here? Is it possible to get my page added, or do I need to override this job or...
OK, seems my (browser)caching was doing something horrible here. The code I mentioned in the original post works like a charm... facepalm