you can define different routes with an explicit language scope.
the page('blog') will have loaded content from that language then.
in your header where you define the link to the rss you need to make sure it is link the that route. but i guess using site()->url() . '/feed' should work.
Thanks, that works for the filtering but then it shows only the German content in the feed and not the English version of it. What is missing to show the English content instead?
Thanks for the hint, that did the trick
Now I only have to find out a way to show a translated description for that or just use a short name that doesn’t need to be translated…
It works with the title but not with the description (in my case called “text”), which just stays empty while I can access it in a template via <?= $page->text() ?>:
Hi
I’m using your plugin to make a sitemap but most of my images are stored inside the site folder, and images are not indexed. On my homepage template, every images are coming from this folder. How to resolve this ?
I’ve been trying to set this up for a while now, but my feed URL is just empty. I’m using a $kirby→collection(…) to get the pages I want in the feed. The collection seems to work, it contains all the pages I want it to contain, but once I add …→feed($options) to the line of code, echo no longer prints anything at all.
i would guess adding route with matching name echoing your custom xsl should do. the plugin does not itself register a route for the xls so that should be fine.
[
'pattern' => 'sitemap.xsl',
'method' => 'GET',
'action' => function () {
// content of
// https://github.com/genmon/aboutfeeds/blob/main/tools/pretty-feed-v3.xsl
// in a snippet/aboutfeedxsl.php file
snippet('aboutfeedsxsl');
die;
}
],
The plugin is ready for Kirby v5 and has been updated with new helpers and better caching logic to greatly improve performance on bigger collections (noticeable at 500+ pages).
It can still generate ATOM/JSON/RSS feeds and XML sitemaps from any Page Collection.
For example, config uses routes to create a virtual blog and sitemap.xml.
site/config/config.php
return [
'routes' => [
[
'pattern' => 'feed',
'method' => 'GET',
'action' => function () {
$options = [
'title' => 'Latest articles',
'description' => 'Read the latest news about our company',
'link' => 'blog',
'feedurl' => site()->url() . '/feed/', // matches pattern above
];
// while this would be possible
// return page('blog')->children()->listed()->flip()->limit(10)->feed($options);
// using a closure allows for better performance on a cache hit
return feed(fn() => page('blog')->children()->listed()->flip()->limit(10), $options);
}
],
[
'pattern' => 'sitemap.xml',
'method' => 'GET',
'action' => function () {
// while this would be possible
// return site()->index()->listed()->limit(50000)->sitemap();
// using a closure allows for better performance on a cache hit
return sitemap(fn() => site()->index()->listed()->limit(50000));
}
],
// ... other routes,
],
];