App-Dependent Contributor-List-Rendering-Problems

Hi, I searched for similar topics but couldn’t find any. Please ignore the notes about the JavaScript/RSS - I’ll create a separate topic about this.

As you see, some podcatchers have problems showing the contributors list in an excepted way. Is there anything we can do about this (please click the image, you’ll see 4 different podcatcher)?

JavaScript in RSS is usually not executed.

The rendering bug in Overcast has been reported to the author many times but was never fixed until now.

But it might be worth reviewing what we can do to improve this. You can tweak the templates yourself to play around with other HTML.

In the webbrowser and RSSRadio the JavaScript works perfectly fine so I was surprised that most Apps don’t - even though I understand that might be for security reasons.

I need to iterate over an custom Array (with some names and numbers) and dependent on the current Episode-Number show the people who supported this. As far as I know I can’t do this with Podlove-Template, can’t I?

This is my code:

<p>
<b>Patreon-Unterstützer dieser Episode:</b><br><br>

<script type="text/javascript">
var supporter = [
  ["Bootsmann Games",       1, 99, "http://www.patreon.com/bootsmanngames"],
  ["Kevin Gregory Agwaze",  1, 99, "http://www.kevin-agwaze.com"],
  ["Christian Putzke",      1, 6, "http://www.christian-putzke.de"],
];

//get episode title and extract the episode number
var episodeTitle = "{{ episode.title }}";  //double quote IMPORTANT because ep06 has the word >Let's< in the title where the ' breaks the script when you don't use double quotes here

episodeTitle = episodeTitle.split(" ")[0];
currentEpisodeNumber = parseInt(episodeTitle);

//compare all supporter with current Episode number
for (index = 0; index < supporter.length; ++index) {
    
    //extract data
    name = supporter[index][0]
    subStart = supporter[index][1]
    subEnd = supporter[index][2]
    supporterURL = supporter[index][3]
    
    //check if subscriptions is still valid
    if ((currentEpisodeNumber >= subStart) && (currentEpisodeNumber <= subEnd))
    {
        if (supporterURL != "") { document.write('<a href="' + supporterURL + '" target="_blank">'); }
        document.write(name);
        if (supporterURL != "") { document.write('</a>'); }
        //add a "-"
        document.write(' - ');
    }
}

document.write(' Vielleicht auch Du? <a href="https://www.patreon.com/gamedevpodcast" target="_blank">Unterstütz uns hier.</a>');
</script>

At first glance it looks like it should be doable in Twig, the language used to render Podlove Templates.

1 Like

You were right, I did it in Twig. It’s a little weird. I don’t have empty lines between the code-lines and also removed tabs and spaces before/after code-lines but still the generated HTML looks like this (at least one empty line between every iteration of an array-element):

Patreon-Unterstützer dieser Episode:

Bootsmann Games -

Kevin Gregory Agwaze -

Andreas Fischer -

Simon Fuchs -

Tobias Kuhnert -

The Twig-Code:

Patreon-Unterstützer dieser Episode:

{%
set supporters = [
[“Bootsmann Games”, 1, 99, “http://www.patreon.com/bootsmanngames”],
[“Kevin Gregory Agwaze”, 1, 99, “http://www.kevin-agwaze.com”],
[“Christian Putzke”, 1, 6, “http://www.christian-putzke.de”],
[“Christian Greiner”, 1, 8, “”],
[“Andreas Fischer”, 1, 99, “”],
[“Simon Fuchs”, 1, 99, “https://www.artstation.com/artist/simonfuchs”],
[“Tobias Kuhnert”, 1, 99, “http://141.64.64.210/BeuthMedia/portfolio/zdf-augmented-reality-app-bergretter”],
[“Kate Bernard”, 1, 99, “”],
[“Matthias Haan”, 1, 99, “”],
[“Fumio Katto”, 1, 99, “”],
[“Emre Karabacak”, 1, 99, “https://www.artstation.com/artist/emre-karabacak”],
[“Simon Uhrmann”, 8, 99, “https://mordsgau.de/”],
[“Sascha Henrichs”, 9, 99, “https://saschahenrichs.artstation.com”],
[“Florian Phillip Smolka”,9, 99, “http://www.mimimi-productions.de/”]
]
%}
{# Get Episode Title and cut out the first part (episode number) #}
{% set episodeNumber = episode.title|split(’ ', 2)[0] %}

{% for supporter in supporters %}
{% set name = supporter[0] %}
{% set subStart = supporter[1] %}
{% set subEnd = supporter[2] %}
{% set supporterURL = supporter[3] %}
{% if episodeNumber >= subStart and episodeNumber <= subEnd %}
{% if supporterURL != “” %}{% endif %}{{ name }}{% if supporterURL != “” %}{% endif %} -
{% endif %}
{% endfor %}
Vielleicht auch Du? Unterstütz uns hier.

Try wrapping everything in

{% spaceless %}
    {# The rest of your code #}
{% endspaceless %}