Customizing Gallery Footers

I posted some Thanksgiving photos on Friday and I was trying to figure out how to add footers to my Gallery pages to signfy my Creative Commons licensing — under the license I chose, you can “copy, distribute, display, and perform” the photographs as long as you give me credit (commercial use requires separate permission).

Writing some HTML & CSS wouldn’t be hard, but I wasn’t sure which Gallery files I needed to modify. After some searching, I soon found EclecticPixels’ Gallery customization tutorials (the Gallery forums can also be handy for this kind of thing). And the part that applied to me was the second part on headers and footers. But, you only want to add a header or footer, then you may find the steps here easier (for one thing, EclecticPixels’ tutorials create extra nested tables, which isn’t necessary).

I’ve only tested these directions with Gallery 1.4.1, but they should work for Gallery versions from 1.4.1 to 1.9x (Gallery 2.x may be completely different).

  1. If it’s a Creative Commons license that you’re adding, you’ll need to go through their license selection wizard if you haven’t already. That will then take you to a “Mark Content” page which has some pre-built HTML code which you can either use as-is or as a starting point.

  2. In any case, the Gallery files you’ll need to modify are in the “html_wrap” directory which branches off your main Gallery directory. You’ll need to grab “wrapper.footer.default” if you’re adding a footer (or “wrapper.header.default” if you’re adding a header). If you’re downloading these from your web host, remember to set your ftp client to ASCII mode.

  3. Before making any changes to the file(s), save them without the “.default” extension (as “wrapper.footer” and “wrapper.header”, respectively) to ensure that the original files stay intact (the customized files need to have these new filenames anyway). And, if you’re only adding a footer, you don’t need to bother with wrapper.header.* (and vice-versa if you’re only adding a header).

  4. Open up the file in a text editor and, if your editor has syntax highlighting, you can set it to PHP highlighting mode (this will make the file easier to read, but there’s no consequence if your editor doesn’t have syntax highlighting for PHP files). Then, scroll to the bottom of the file and add any HTML code that you want in your footers. (Here’s my finished wrapper.footer for an example.)

  5. If you need to add any CSS to accompany your HTML, you can add that to the bottom of your Gallery skin’s CSS file (which can be found at http://yourdomain/path/to/gallery/skins/skin-name/css/embedded_style.css). And, for an easy back-up path in case your changes are overwritten when you next upgrade Gallery, you may want to make a note of your CSS changes in a separate file as well.

  6. That’s it :). Just upload your new wrapper.footer (and/or wrapper.header) into “html_wrap” and the updated embedded_style.css (if you even changed that) on top of your old CSS.

(You can see my new footer on any of my Gallery pages.)

One thought on “Customizing Gallery Footers

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.