bnomei / kirby3-feed

Generate a RSS/JSON-Feed and Sitemap from a Pages-Collection.
https://forum.getkirby.com/t/kirby3-feed-rss-json-sitemap/23574
MIT License
64 stars 7 forks source link

renders json output #34

Closed demlak closed 3 years ago

demlak commented 3 years ago

hey there.. i'm using this plugin with this theme: https://www.one.thezero.club/ as you can see here: https://www.ecovillage-hannover.de/test3/feed the description is just the plan json field.. not thaaaaat good =)

also some code-snippets are also displayed, when using them inside journal entries

how to fix?

thx

bnomei commented 3 years ago

did you create a route to the virtual page to display the feed? https://github.com/bnomei/kirby3-feed#usage

demlak commented 3 years ago

Hey.. thx for your answer.. this is the current output: https://www.ecovillage-hannover.de/feed

thats the route inside config:

    [
            'pattern' => 'feed',
            'method' => 'GET',
            'action'  => function () {
                $options = [
                    'title'       => 'rss Feed',
                    'description' => 'ecovillage hannover',
                    'link'        => 'journal'
                ];
                $feed = page('journal')->children()->listed()->flip()->limit(14)->feed($options);
                return $feed;
            }
        ]
demlak commented 3 years ago

using toBlocks() instead of kirbytext() in line 18 of kirby3-feed/snippets/feed/rss.php fixes the issue.. any idea of doing this by not modifying the plugin, but inside config or so?

Or maybe it's possible to have an auto-detection what type of field it is?

i also tried the route-option 'textfield' => 'blocks', which seems to kill all =)

bnomei commented 3 years ago

please create a snippet and use $item to create the logic you need. you can make the plugin use your snippet via the $options.