Gallery2:How to Add Custom Banner or Remove Gallery Logo - Gallery Codex
Personal tools

Gallery2:How to Add Custom Banner or Remove Gallery Logo

From Gallery Codex

You can replace the Gallery logo with your own logo at the top of every page.

Step 1. Make a logo that fits the space in the theme you are using. Check the height & width of the Gallery logo being used in the theme.

Step 2. Create a directory called "local" in the theme's template directory.

The easiest way, for you non-geeks, is to use your FTP program.

The new directory should be here:

http://yourWebsite.com/gallery/themes/yourTheme/templates/local

You may have the Gallery installed in a different location. Just make sure that wherever Gallery is installed, the rest of the line is as in this example.

Step 3. On your computer, make a copy of the file "theme.tpl".

Making a copy means you will have a saved copy of the original file if something breaks.

Open this file in a text editor (not a word processor).

Step 4. Find the following section near the top of the file:

<div id="gsHeader">
  <img src="{g->url href="images/galleryLogo_sm.gif"}" width="107" height="48" alt=""/>
</div>

Change the "img" line to something like this:

<img src="{g->url href="themes/YourTheme/images/yourLogo.gif"}" width="107" height="48" alt=""/>

Change the width and height to the proper size. The alt text should be a description of your website's gallery (a brief phrase).

Below this is a similar set of lines:

<a href="{g->url}"><img src="{g->url href="themes/croos/images/galleryLogo_sm.gif"}" width="107" height="48" alt=""/></a>

Make the same changes to the text following "url href".

Step 5. Make the link point to your website.

Remove the line:
<a href="{g->url}">
and replace it with the required link to your website as in this example:
<a href="http://yourWebsite.com/">

Copy this file (via ftp) to the local folder you made earlier.

Step 6. Copy your logo to the images directory.

Each theme has an images folder; simply copy your file to this folder via ftp.

Files can be in formats other than gif; a transparent gif may fit into the existing structure better. At this point, you'll want to work on the theme via css -- and that's a whole different discussion.

Step 7. Clear the template cache.

Go the Site Admin/Maintenance and click the link for "delete template cache" (click "run now" under Action). Your logo should now appear at the top of the page.


=== Multisite Logo ===

To use a different logo in each multisite install use a line in theme.tpl like this:

 <img src="{g->url href="sitelogo.jpg" forceDirect=true}" alt=""/>

Then put a sitelogo.jpg file in each multisite directory.