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 8 forks source link

Different settings for different data types? #28

Closed dantz closed 4 years ago

dantz commented 4 years ago

I'm pulling feed contents from two different pages containing two different types of content:

$feed = page('videos','blog')

Is there a way to make all video posts use 'textfield' => 'intro', while the blog posts use 'textfield' => 'text',?

bnomei commented 4 years ago

both no. but you could create a pagemethod feedtext and use that.

Kirby::plugin('my/page-methods', [
    'pageMethods' => [
        'feedtext' => function () {
            return $this->template()->name() === 'video' ? $this->intro() : $this->text() ;
        }
    ]
]);