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 -%>
Comments

Leave a response

Comments