Lightbox V2 and the flickr sidebar...

Posted by Steve Longdo Tue, 23 May 2006 06:57:00 GMT

So to grant the flickr sidebar access to the powers of the lightbox script is a fairly simple trick, in your theme's views/plugins/sidebars/flickr/content.rhtml file (you can make this path and the file if it is not present in your particular theme.)

<% if @flickr -%>
<h3><%= @flickr.title  %> (<%= link_to "flickr", @flickr.link %>)</h3>

<div id="flickr">
<% for pic in @flickr.choose(count.to_i) -%>
  <div class="flickr<%= format%>">

<%= case format
          when 'square':
            link_to image_tag(pic.square, :alt => pic.title),
              pic.image.gsub!(/_m/,''),
              { :rel => 'lightbox[flickr]',:alt => pic.title, :title => pic.title }
          when 'rectangle':
            link_to image_tag(pic.thumb, :alt => pic.title),
              pic.image.gsub!(/_m/,''),
              { :rel => 'lightbox[flickr]',:alt => pic.title, :title => pic.title }
          end

 %>
</div>
  <% end -%>
</div>
<% end -%>

Lightbox V2 rocks... 2

Posted by Steve Longdo Fri, 31 Mar 2006 17:08:00 GMT

Seriously cool update to the lightbox script. Lokesh has has outdone himself. I altered my flickr sidebar to use the new version of lightbox script. Hovering over the image on the the left or right will let you scroll through the pics on the sidebar in all their glory!

Now when you click on a photo, it opens up... Just try it already!