[podlove-episode-contributor-list] not returning a list

Hi community

Inspired by the success I had with my archive page, I wanted to add a guests page as well. :stuck_out_tongue_closed_eyes: The problem is, that [podlove-episode-contributor-list] does not return a list when used on a page. I guess it should? The shortcodes page says:

If used on a non-episode page, it lists all existing contributors with at least one contribution to an episode. Requires “Contributors” module.

The “Contributors” module is activated.

Strangte is, that [podlove-global-contributor-list] and [podlove-podcast-contributor-list] do return a list just fine.

My goal is:
Showing a list like the one [podlove-global-contributor-list] returns, but only for contributors of a certain group or role. The filters/parameters don’t seem to work for [podlove-global-contributor-list], eg. [podlove-global-contributor-list role="guest"].

This shortcode can only be used on episodes, not pages.

The template for that shortcode is this: http://docs.podlove.org/podlove-publisher/reference/templates.html#list-of-podcast-contributors. You can copy this and add group/role filters in this line: {% for contributor in podcast.contributors %}.
For example: {% for contributor in podcast.contributors({role: "guest"}) %}

1 Like

Thank you for your help!
I will try creating my own template and post it here for others when I’m done.

Then this is a bit misleading, if not wrong:

If used on a non-episode page , it lists all existing contributors with at least one contribution to an episode.

1 Like

Absolutely, I fixed the documentation. Thanks!

1 Like

Hello again!

I’ve worked on a guest list lately. I came up with this:

{# @contributors/podcast-contributor-list.twig #}

<table class="podlove-global-contributors">
    {% if option.title %}
        <thead>
            <tr>
                <th colspan="2">{{ option.title }}</th>
            </tr>
        </thead>
    {% endif %}
    <tbody>
        {% for contributor in podcast.contributors({role: "Gast"}) %}
            {% if contributor.visible %}
                <tr>
                    <td rowspan="2" class="avatar-cell" width="60">
                        {{ contributor.image.html({width: 60, height: 60, class: "avatar avatar-" ~ size ~  " photo", alt: "avatar" }) }}
                    </td>
                    <td class="social-cell">
                        <strong class="contributor-name" style="font-family: sans-serif;">{{ contributor.name }}</strong>
                        <div class="social-icons">
                            {% for service in contributor.socialServices %}
                                <a target="_blank" title="{{ service.title }}" href="{{ service.profileUrl }}">
                                    {{
                                        service.image.html({
                                            width: 32, 
                                            class: "podlove-contributor-button",
                                            alt: service.title ~ " Icon"
                                        }) 
                                    }}
                                </a>
                            {% endfor %}
                        </div>
                    </td>
                </tr>
                <tr class="episode-row">
                    <td class="episodes-cell" style="font-family: sans-serif;">
                        <ul>
                        {% for episode in contributor.episodes %}
                            <li>
                                <a href="{{ episode.url }}">{{ episode.title }}</a>
                            </li>
                        {% endfor %}
                        </ul>
                    </td>
                </tr>
            {% endif %}
        {% endfor %}
    </tbody>
</table>

<script type="text/javascript">
(function ($) {
    $(document).ready(function() {
        $(".podlove-global-contributors .episodes-cell").each(function() {
            var items = $("li", this);


            if (items.length > 3) {
                $("li:gt(2)", this).hide();
                $('<span class="show-all-episodes" style="font-size: 85%;"><a href="#">… alle anzeigen</a><span>').insertAfter($("ul", this));
            }
        });

        $(".podlove-global-contributors").on("click", ".show-all-episodes a", function(e) {
            e.preventDefault();

            $(this).closest(".episodes-cell")
                .find("li").show().end()
                .find(".show-all-episodes").hide();
        });
    });
}(jQuery));
</script>

<style type="text/css">
.podlove-global-contributors td {
    vertical-align: top;
    line-height: 1.3em;
}

.podlove-global-contributors .avatar-cell {
    max-width: 100px;
    text-align: center;
}

.podlove-global-contributors td {
    border-top-width: 0px;
}

.podlove-global-contributors .episode-row {
    /*margin-bottom: 10px;*/
}

.podlove-global-contributors td ul {
    margin: 0;
}

.podlove-global-contributors .social-cell li {
    margin: 0;
}

.podlove-global-contributors .social-cell {
    border-bottom-width: 0px;
}

.podlove-global-contributors .episodes-cell {
    padding-top: 0px;
}

.podlove-global-contributors .episodes-cell li {
    display: inline-block;
    margin: 0;
}

.podlove-global-contributors .episodes-cell li a {
    background: #eee;
    padding: 2px 10px;
    line-height: 170%;
    border-radius: 10px;
}

</style>

Feel free to copy and improve. Most of it is taken from here. I’m a total noob when it comes to coding. Therefore I’m sure people will be able to make this better.

I only have one problem with that list: The list will not be fully alphabetical. Two of my guests (one named exe, the other named moep0r) will appear at the bottom of the list.

Why?

Could you file a bug report? It would be helpful to know what name fields (public, private nick) you have used and what’s in them. Sorting should work based on whatever {{ contributor.name }} is.

Done.