|
Re: image attachments display
Tuesday, February 6, 2007, 5:42:55 AM, John wrote:
> I would be interested in looking it over but only if you feel like
> reviewing the code or just want to post it in the group or something
> where it could be beneficial to all.
I've attached the gallery dynasnips as they are in use at
sock.strain.at. The basic idea of the gallery is as follows:
You have a web-accessible directory where you store all your image
galleries. Within this directory, each gallery is store in it's own
subdirectory. Within each gallery subdirectory reside the files for
your full-sized images; within a small/ subdirectory reside the
according thumbnail files.
So for example, let's say you have all your galleries in
/home/user/public_html/gallery/ and you have two galleries
"uk2005" and "nz2006" then your directory structure would look like
the following:
/home/user/public_html/gallery/
uk2005/
img001.jpg
img002.jpg
small/
img001.jpg
img002.jpg
nz2006/
foo.jpg
bar.jpg
small/
foo.jpg
bar.jpg
If you use the same name for thumbnail files and fullsize files, you
are settled. You need not to, though - it's sufficient if the
thumbnail and fullsize file are at the same position in their
respective sorted list of files.
To display a gallery, create a snip and call the gallery dyna
appropriately. Eg. to display a image gallery for the "nz2006" folder
above, create a "gallery-nz2006" snip and enter {!gallery:nz2006/}.
The gallery is currently designed to run in a popup window, so the
"gallery-nz2006" snip created above needs to be displayed in a popup
window. To ease this, there is the glink dyna which creates some <a
parameters. Ie. to link to the gallery we created before, simply write
eg. <a {!glink:gallery-nz2006}>New Zealand 2006</a> in some snip. For
this to work, you must also include popup.js in your main template.
To get the gallery to work, you need to adapt the gallery dyna a bit
to your needs:
- you MUST adapt the file-prefix and url-prefix variables in
%gallery.r; file-prefix points to the root directory where your
gallery files are stored. url-prefix is the absolute url that allows
web access to this directory.
ie. if you place a "test.txt" in your gallery root, this file must
be at <file-prefix>test.txt in your file system and you must be able
to access it via http://<your-domain><url-prefix>test.txt
- you almost certainly have to adapt arr-left-url and arr-right-url to
point to the URL of some images that you want to use as
previous/next icons.
- once you have that stuff running, you most likely want to adapt the
template at the bottom to match your desired gallery design. Currently
there is no vanilla markup expansion done in this template.
This may now sound a bit elaborate, however, it's not that difficult
with some basic Vanilla experience. To sum things up:
- place the attached dynas in your apps/ folder
- place the attached popup.js in your res/ folder, include the
popup.js in your main template (vanilla-template)
- create the gallery folder structure
- adapt gallery.r to properly point to your gallery structure
- (x) upload fullsize and thumbnail images for a test gallery
- (y) create a gallery snip calling the gallery dyna
- (z) create a second snip calling glink to link to the gallery
If that works, go on and adapt the template inside gallery.r to your
needs. If all is nice and pleases you, the last three steps (labelled
x,y,z above) is what you'll repeat every time you add a new gallery.
So, I'll leave it at this already rather lengthy explanation. If
anyone still decides to give it a go, please do not hesitate to ask if
questions arise -- I'll be happy to help.
... earl walker out ...
|