Extension, Fieldtype, Plugin

Archived
Forum
(read-only)

Flickr

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Brett DeWoody

     

Photo Count/Number for custom URL

Feature Request

Jez - Make Hay
Jez - Make Hay

Hi Brett

Loving this add-on but I’m wanting to output code that will create a link with the specific image sequence number (1,2,3,4 - not the img ID). Which I can then pass in a URL for JQuery/Lightbox etc to grab the start image from the last segment of the URL e.g.

mydomain.com/gallery/entry-title/4

Which would then allow the slideshow to start at image number 4 using that as the last segment of the URL.

Something like:

<a href="/gallery/view/entry-title/{flickr_count}">
<
img src="http://farm4.static.flickr.com/blah.jpg" alt="">
</
a

Where I made up a tag {flickr_count} which would be the number for that image in the set - starting at 1.

Are there any template tags or variable I’ve missed which could do this? I’m using a custom field to feed in the ‘Set ID’ and create the gallery that way and this is my EE code:

{exp:eehive_flickr:photoset set_id="{flickr_id}" limit="100" size="square"}
<a href="/gallery/view/{url_title}/" rel="gallery" title="{flickr_title}">
<
img src="{flickr_img}" alt="{flickr_title}" />
</
a>
{/exp:eehive_flickr:photoset} 

Or is this something I will need a bit of php for?

Thanks in advance Brett - I’m sure more people could make use of this too if it’s worthy of becoming a variable

Jez - Make Hay
# 1
Jez - Make Hay

I ended up using a little PHP to do this - like so:

<?php $count 1?>
{exp
:eehive_flickr:photoset set_id="{flickr_id}" limit="100" size="square"}
<a href="/gallery/view/{url_title}/<?php echo $count; ?>" rel="gallery" title="{flickr_title}">
<
img src="{flickr_img}" alt="{flickr_title}" />
</
a>
<?php $count++ ?>
{
/exp:eehive_flickr:photoset} 

{flickr_id} is a custom field as the above code is in a channel:entries loop.

With PHP set on output this creates a sequential number for each image thumbnail which does exactly what I need it to do