Adding external files to your HTML gallery
If you’ve been trying to create your own galleries based on the Andy Rahn (Lightroom Web Module engineer) tutorial on John Nack’s blog, I hope you’ve taken note of the new file locations that Andy mentions in his Lightroom Journal Post. You have a simple page that shows a thumbnail of all the images, but now you’d like to put a bit of shape on it.
You could simply add CSS inside the ‘index.html’ file call in your transformer.xslt, but this can be cumbersome once we scale to multiple pages. An external CSS file would be better. Obviously the Web Gallery needs to both see and copy the CSS file to the created gallery. So how do we do this?
It’s all done using an additional file called gallery.xml. Create a blank txt file and save it as ‘gallery.xml’ and paste the following into it and save it beside ‘galleryMaker.xml’.
That’s our basic gallery.xml file. To call files from it we use the
must be written
. The ‘/’ acts as a close tag.
UpdatePaddlefish has noted in the comments that IE 6 gets confused by this and details a workaround there.
To include our CSS file we call it like this:
In our file this looks like:
If we include background url’s in our CSS file, we need to include them in the gallery folder and in gallery.xml, eg
You can also save the files in subfolders to keep it tidy and call them from subfolders. eg:
would call the jpg from the images subfolder. These subfolders are relative to the current folder. On Mac it is possible to call the CSS file directly in the transformer.xslt file, but John Beardsworth pointed out this does not work for him on PC. While related to how to call a file, It’s merely a matter of pasting code, cookbook style, and I’ll just make it a post on its own. Watch this space.
Hopefully this will be helpful to those building from scratch and thanks to Andy Rahn for the original tip when I was calling files that were already online.
Get all outdoorsy with Pentax's Optio WG2 and WG2-GPS
Canon's complement of compacts
How to use a grey card
We’re All Bozos On This Bus--The Red Bus to Hell
Nikon PB4 Bellows Reborn
Worlds Fastest Camera
The New Sony NEX 7
Photojojo iPhone Telephoto Lens review — AudioCast
Photo Accessories that Fail Security Checks
My week with Q
Studio equipment buying guide for beginners
VSCO Film Studio Review
Lessons in Lighting
The russellgraves.com Photo Minute - Truck Blinds
Photographing Children in the wedding party
Cattle Country
Creative Photo Valentine Surprise
How to Use Multiple Lights for Dramatic Portraits
Making your own flash diffuser
LR4 free presets: Faded series
Using Sync for Video in Develop
A gift of flowers: unfold your senses
On Set of "Love & Robots" the Film
My Night with Ilford Galerie Gold Silk Fibre
FOTOMOTO - Why I Left











Silhouettes & Photo Contests
Cyan, not just another color
Our 26 best photo projects of 2011
Family Ties That Bind
Animal Group Portraits
A Brief History Of Light & Photography: Part 3 of 3
A Brief History Of Light & Photography: Part 2 Of 3
Lightroom Interview: Kevin Tieskoetter
Always Dream Big
Gallery: Embedded with the Territorial Army
Getty Villa Malibu — 4 Old Faces, 1 Sunken Garden — GALLERY (6 photos)
Wildlife photography for the masses
The 110 page guide to post-processing
How much should you charge for a photograph?
Santa Pictures + Marketing for your Business































Comments
Hi, Sean, thanks for digging into this on your own!>One note about XML in HTML. I was a little naive, assuming that the browsers out there would “do the right thing”. Oops! Never assume the browsers will do the right thing!>For example, you suggest writing as . That’s perfectly valid XML. Unfortunately, I think Internet Explorer 6.0 will be confused by some tags that are in this all-in-one form.>For example, the tag. If you were to write the page won’t open in internet explorer 6. IE6 gets confused by the all-in-one form .>So in my transformer, I’d have to write it like this:>>>Unfortunately, the XSLT engine knows that that can be simplified to the all-in-one form! So to prevent the XSLT engine from doing that, I have to insert a comment in the final output, like this:>>padding for ie>>Somewhere in here is where I realized that the idealized dream of XML -> HTML via XSLT is actually more of a nightmare. I’m sorry about that :-\
I’d seen this in the templates Andy, and was curious as to it, cheers for the clarification. There’s so much inside them, that it’s hard to know what’s in for what reason!
Maybe we’ll all find a better way
Post new comment