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.
Can you fix the focus on a blurry photo after the fact?
The birth of Mirrorless Cameras
MiMedia, letting you access your media, wherever you are
Lightroom 4 on Apple's Mac App Store
Choosing your first dSLR camera
New York City can be beautiful!
The Fujifilm Finepix X10, A Review
Choosing the Right Light Stand
Photojojo iPhone Telephoto Lens review — AudioCast
My week with Q
How To Become A Successful Photographer
"When the Wind Stopped" — poem with 4 photos
Strategies for shooting action
20 Tips for Insects on Flowers
Cast aways - saving those photographic memories
One Man Show: My 25 Years With Digital Photography
Studio, Flash, & Available Light — Three Books Reviewed
Portrait styling: dangerous pairings
Adobe Photoshop CS6 Product Managers Interview Audiocast
A gift of flowers: unfold your senses
On Set of "Love & Robots" the Film
Ilford Galerie Gold Fibre Silk Inkjet Paper — Audiocast











Planning “National Geographic” style photo travel
Wilderness Travel 1 Rainforests – Essential Gear
Backlighting Basics
A Brief History Of Light & Photography: Part 3 of 3
A Brief History Of Light & Photography: Part 2 Of 3
What Moves You?
FIGURES IN MOTION: Decades of Evolving Personal Imagery in Photography, Part 7
Lomography Store, Austin, Texas — GALLERY
GALLERY — Up to $1,000 Reward for Cattle Rustlers
Taking your Portraiture Higher
The "Bible" of Time-Lapse Photography
Interview with Harold Davis — Closeup Maestro of Flowers & Water Drops
Interview with Steve Caplin — Photoshop Digital Artist, Commercial Illustrator, & Author
Easy technique to select, edit and sequence keywords for web
How much should you charge for a photograph?



























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