Modify Lightroom Build-in templates

When I upload images to bermione.be (and thus not uploading them to Picasaweb), I’m using the Lightroom build-in Flash template, since that is exactly what I was looking for. Not too fancy, but not too simple either. Only minor is that I had to add my Google Analytics code every time to the generated html page. But I always forget to add it before uploading and I notice that only a day later, when the gallery was visited already and thus I loose some analytics.

Yesterday, once again, I generated a new gallery, uploaded it to the server but forgot to add the Google Analytics script. And that I noticed today so I opened the html to add the script and… was surprised the script was already there!
Then I remembered, I was once searching for a way to modify this template in order to have this Google Analytics script automatically added: I wanted to change the build-in template and insert the script so that it would be there every time I generate a new gallery.
I know I did a long research for it and finally found how to do this. But that’s a long time ago.

At this point, I started a search on the Internet to find out which file I once edited but… I couldn’t find it anymore. So I started a search locally and finally found the template.

On a Mac, the default flash template, which includes the html you have to change, is located inside the Adobe Lightroom.app. The file /Applications/Adobe Lightroom.app/
Contents/PlugIns/Web.agmodule/
Contents/Resources/galleries/default_flash.lrwebengine/index.html
is the one you want to change.

To find this file using the Finder:

  • Go to /Applications, select Adobe Lightroom.app and Action > Show Package Contents
  • Browse to Contents/PlugIns/ Select Web.agmodule and Action >Show Package Contents
  • Browse to Contents/Resources/galleries/, select default_flash_lrwebengine and Action >Show Package Contents
  • There you can see different files and folders, one amongst them is index.html and that is the file you want to change.

Open this with any text editor (but be aware that as of Leopard, TextEdit.app opens HTML in a WYSIWYG mode! I prefer Dashcode, but then you must have installed the optional Developer part of Mac OS X) and add the Google Analytics script at the bottom of the file (as described online). Save the file and generate your gallery. You’ll see that the Google Analytics code is right there!

Other templates are right there, in the Web.agmodule/Contents/Resources/galleries