Using twig elements in the rss feed


#1

Hello,
I’m using some extra twig items (I’m not sure what to call them) - part of a custom blueprint (?) that allows me to add extra information to my blog posts, like Author Name.

In the template I call these up by using, e.g. {{ page.header.author }}

I’d like to add the name of the author to the link in the rss feed.

I’ve tried inserting {{ page.header.author }} into the feed.rss.twig file in the Grav Feed plugin templates folder:

<title>{{ item.title|e }} by {{ page.header.author }}</title>

but it’s not working. I really don’t have a good enough grasp of the theming / twig / plugin system to solve this problem so would appreciate any suggestions you might have, to point me in the right direction.

Thanks so much, bye
Adam


#2

Notice how the title is pulled from the object item and not page.header. So start with item.author or item.header.author first. (Not tested.)

You should read some primers on Twig and the Grav docs. It’s the only way to learn :slight_smile: