Re: [armstrong] Displaying authors (photographers) tied to an article's image?

41 views
Skip to first unread message

Dave McLain

unread,
Nov 8, 2012, 4:27:03 PM11/8/12
to armstr...@googlegroups.com
The lead_art template tag was probably a mistake (by me). It was added before we had fleshed out the rest of the related_content interface. I think the better way of approaching rendering lead_art would be something along the lines of

{% with object.related.lead_art.0 as lead_art_obj %}
    {% if lead_art_obj %}
        {% render_object lead_art_obj 'article_wide' %}
    {% endif %}
{% endwith %}

If the image has an authors field you can use {{ object.authors }} inside /layout/images/image/article_wide.html or {{ lead_art_obj.authors }} inside of the {% if %}{% endif %}. The lead_art tag is a thin wrapper on top of calling render_visual, which is itself a very thin wrapper on top of armstrong.core.arm_content.images.sorl.get_preset_thumbnail, which you can call with the content_helpers template tag library's filter 'thumbnail'.


dave


On Wed, Nov 7, 2012 at 8:56 PM, Bob <bobge...@gmail.com> wrote:
An image has been tied to an article via the related contents section of the article page.

To show the image in the article template, we use the following line:
                {% lead_art object 'article_wide' %}

What is the template syntax to print out who the authors (photographers) of the image were?  We'd be storing that info either in the authors section of the image, or the authors override or authors extra sections.

I'm thinking this is simple, but for some reason I'm stuck. Any help would be much appreciated.

Thanks


Reply all
Reply to author
Forward
0 new messages