kltrg
July 5, 2016, 8:09pm
1
I’d like to show the contributors to every episode as an unordered list. But, I’d like the role to be shown as well. Like this:
First Person, presenter
Second Person, guest
Third Person, sound design
I couldn’t find any documented way to do this. Wouldn’t it be great if [podlove-episode-contributor-list preset=list roles=yes]
or
{% for contributor in podcast.contributors({scope: "episode"}) %}
{{ contributor.name }}, {{ contributor.role}}
{% if not loop.last %}, {% endif %}
{% endfor %}
would work? Would this be difficult to implement?
The Twig template looks like the right idea. Does it not work?
kltrg
July 7, 2016, 4:46pm
3
Unfortunatelly, it doesn’t. According to this , scope: “episode” is not part of the specification. I made it up. Wishful thinking. Can you implement it?
I see, but this should work:
{% for contributor in episode.contributors %}
kltrg
July 11, 2016, 11:58am
5
It works. Thanks, Eric.
I now wonder if I can display the link if there is any. That would be great!
kltrg
July 12, 2016, 8:55am
7
A link to the contributor’s website if there is any.
Maybe something like this:
{% for service in contributor.services({type: "website"}) %}
<a target="_blank" title="{{ service.title }}" href="{{ service.profileUrl }}">
{{ service.image.html({width: 20}) }}
</a>
{% endfor %}
See http://docs.podlove.org/podlove-publisher/reference/template-tags.html#contributor for all contributor.services
parameters.
kltrg
August 25, 2016, 10:12am
9
Thanks a lot, Eric. With your example, I managed to write the code that is doing exactly what I need. It goes like this:
Edit: The forum software wont accept my formatting. Here`s a link to my template code: http://pastebin.com/TqtxVqj8