Episode Duration in a Template

Hi,

I was wondering if someone could help me I’ve been going round in circles with this for a day or too now. I’m relatively new to PodLove Publisher I have created a couple of templates and all seem to work well but whatever I try I can’t get the Episode Duration to display. I have read earlier release notes which seem to suggest [podlove-episode-duration] short code is deprecated so I tried using twig tags episode.duration this did display zeros in a time format (so I’m not sure whether the format I put in the Duration field in the post may have been to blame). I then tried using duration and duration.minutes non of which display the duration I typed in the Duration field.

Please could someone help me understand where I’m going wrong.

Regards

Olly

Hi Olly,

you are correct that episode.duration is the new way to display it. Are the zeros a problem then? The separate options have to be appended like so:

{{ episode.duration.hours }}h and {{ episode.duration.minutes }}min

results in: Xh and Ymin as expected in my Podlove instance. Maybe the template tag list forgot to make it clear that episode. has to be retained in the tag. FixingUpdate: Ah, well: better not :wink:

Hope this helps!
Katrin

1 Like

Brilliant Katrin,

Thanks for the explanation.

Regards

Olly.

1 Like

As a bonus, have a look at https://github.com/timpritlove/podlove-templates/blob/master/metaebene-macros.twig#L30 for correct handling of singular / plural forms.

1 Like

Thanks Eric, I’ll have a read of that aswell.

Regards

Olly