Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Getting up and running Your First Gallery

hairballopolis edited this page Sep 13, 2010 · 4 revisions

After the installation you will be able to see the ‘Galleries’ tab in the Radiant administration panel.
Click on it and start creating galleries and uploading images.
Now create a new page, choose one of the layouts created during the gallery extension installation, and set ‘Gallery’ as page type.
Publish the new page and go to its url.

Displaying images from a specific gallery

<r:gallery id="GALLERY_ID">
  <ul>
    <r:gallery:items:each by="position" sort="asc">
      <li><r:gallery:item:path /></li>
    </r:gallery:items:each>
  </ul>
</r:gallery>

Displaying all galleries

<ul>
  <r:galleries:each level="all|top|bottom|current">
    <li><r:gallery:name /></li>
  </r:galleries:each>
</ul>

The value of the level attribute could be:

  • all (default): displays all galleries
  • top: displays galleries without a parent
  • bottom: displays galleries without children
  • current: displays children of the current gallery. If the current gallery is not set, it displays all the top galleries.

Displaying all images

<ul>
  <r:gallery:items:each by="created_at" sort="desc" scope="all">
    <li><r:gallery:item:thumb width="100" height="100" prefix="small" geometry="c50x50"/></li>
  </r:gallery:items:each>
</ul>

The value of the scope attribute could be:

  • gallery (default): displays images of the current gallery
  • all: displays all uploaded images

The current Gallery

Create a gallery tree like the following:

 - Languages
       | - Ruby
       | - Python
       | - Java

Now create a Gallery page (with gallery as page type) called gallery. Go to its url (http://localhost:3000/gallery).
In that page the current gallery is not set, but if you go to ‘/gallery/languages’, the current gallery is Languages,
under ‘/gallery/languages/ruby’ the current gallery is Ruby and so on.

Otherwise you can set the current gallery using the gallery tag:

Thumbnails generation

Thumbnails are generated on the fly with the gallery:item:thumb tag. Inside a page you can write:

The first time you will open that page, the system will generate a thumbnail for the first image of the gallery with id GALLERY_ID.
The signature of that thumbnail will be: ‘small_200x100’.
The next time the system will not generate the thumbnail if that image already has a thumbnail with that signature.
If you want to generate that thumbnail just after the upload of the image, add that signature inside the gallery.yml configuration file:

default_thumbnails: admin_thumb: 300×300 # do not remove admin_preview: 500×500 # do not remove small: 200×100 # this is the signature you use in the page. square: c90x90 # specific sized images with a center crop