Export to GitHub

django-photologue - issue #115

next_in_gallery and previous_in_gallery template tags should be inclusion tags


Posted on May 17, 2009 by Happy Rhino

The next_in_gallery and previous_in_gallery template tags feel like they should be inclusion tags since they generate HTML. Instead, they're simple tags that have hard coded html strings in them. This makes it impossible to override the html behaviour from the project level.

This is an issue because they are both hard coded to use the thumbnail url and I need to use a different size. At this point, my only option is to re-code the tags by hand in my own project.

Comment #1

Posted on Jun 22, 2009 by Grumpy Panda

this patch adds some templatetags to photologue_tags.py it allows you to create you own buttons to next and previous photos It also give acces to some exif informations

Example:

{% load photologue_tags %}

{% for gallery in photo.public_galleries %}

{% get_photo_infos photo gallery as my_photo %}

{% if my_photo.has_next %}
    <p>
    <a href="{{ my_photo.next_in_gallery_URL }}" class="richard"><img src={{ 

my_photo.next_in_gallery_thumbnail }} title={{ my_photo.next_in_gallery_title }}

{% endif %}
  • {{ object.date_taken|date:"d/m/y H:i" }}
  • {{ my_photo.exif.camera }}
  • S: {{ my_photo.exif.speed }}
  • f: {{ my_photo.exif.aperture }}
  • mn: {{ my_photo.exif.focallength }}
  • mn(eq35): {{ exif_focallength35mn object }}
  • ISO: {{ my_photo.exif.ISO }}
  • {% endfor %}

    Attachments

    Comment #2

    Posted on Jul 22, 2009 by Happy Giraffe

    (No comment was entered for this change.)

    Comment #3

    Posted on Jul 23, 2009 by Happy Giraffe

    Fixed in r396.

    Status: Fixed