Radiant extension. Makes it very easy to use fancy box for displaying images in "lightbox" style overlays
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app/models
db
lib/tasks
public
.gitignore
README.rdoc
Rakefile
fancy_box_extension.rb

README.rdoc

Radiant Fancy Box Extension

Makes it very easy to use fancy box for displaying images in “lightbox” style overlays

Installation

git clone git://github.com/gunn/radiant-fancy_box-extension.git vendor/extensions/fancy_box
rake radiant:extensions:fancy_box:update

Add the necessary js, css and images, and add a snippets to include in your pages.

Usage

in the heads of the pages you want fancybox functionality:

<r:snippet name="fancy_box_css"/>

And also in those pages (at the bottom of the body means no extra wait time)

<!-- Add jquery somehow: -->
<script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"
        type="text/javascript"></script>
<r:snippet name="fancy_box_js"/>

Wherever you want an image:

<r:assets:fancy_img image_id="77"/>

You must specify at least image_id or image_title.

Advanced usage

tn_id and tn_title - default to image_id and image_title respectively. tn_size defaults to “thumbnail”

tn_geometry - If your version of paperclipped supports it, you specify a custom size for the thumnail

<r:assets:fancy_img image_title="funky_bacon" tn_size="custom" tn_geometry="260x260>" />

Any attributes prepended with 'image_' will be passed through to the 'assets:url' tag, to find the large image to link to. Any attributes prepended with 'tn_' will be passed through to the 'assets:url' tag, to display the thumnail. All other attributes are used as html attributes for the link.

Neat tricks

Because of the close integration with paperclipped you can use the fancy_img tag anywhere you can use the image tag. Show the page's first attached asset:

<r:assets:first:fancy_img size="thumnail"/>

Create a gallery with previous and next buttons containing each of the current page's attached assets:

<r:assets:each>
  <r:assets:fancy_img rel='gallery' tn_size="thumnail"/>
</r:assets:each>

Copyright © 2010 Arthur Gunn, released under the MIT license