It’s pretty easy. Let’s say you have a website named ‘mywebsite.com’ and you have the gallery installed in the following folder https://www.mywebsite.com/gallery.
Let’s say you have chosen ‘matrix’ as your theme.
Now open a new directory called ‘local’ in the matrix’s template directory. So it will look like the following
https://www.mywebsite.com/gallery/themes/matrix/templates/local
Now open the ‘theme.tpl’ file (it is located in your matrix’s template directory). Open it with a text editor. You can download a free text editor. A good one is TextPad. It’s easy to work with TextPad. You can download it from here
https://www.textpad.com/download/
Now you have opened ‘theme.tpl’ file on your text editor. Find the following line around line 28 (as appeared here on the Textpad, in TextPad from View you can check Line Numbers to get it easily)
<div id=”gsHeader”>
<img src=”{g->url href=”images/galleryLogo_sm.gif”}” width=”107″ height=”48″ alt=””/>
</div>
Change it to
<div id=”gsHeader” align=”center”>
<img src=”{g->url href=”themes/matrix/images/newlogo.jpg”}” width=”675″ height=”110″ alt=”New logo for Gallery”/>
</div>
Note that you can take any file format, here the example name is newlogo.jpg and it’s width is 675 Pixels and height is 110 Pixels. You can make your logo at any width and height. By aligning logo to the “center” will let your logo appear at the center at the top of your page. If you omit this and leave the default line, then your logo will appear on the left corner like the default Gallery2 logo. In alt we added =”New logo for Gallery”. You can choose any of your slogans here. Every time your visitor will move the cursor over the logo, this will appear. You can omit it if you like.
Now around line 33 (as it appears here on the TextPad) you will find
<div id=”gsHeader”>
<a href=”{g->url}”><img src=”{g->url href=”images/galleryLogo_sm.gif”}” width=”107″ height=”48″ alt=””/></a>
</div>
Change it to
<div id=”gsHeader” align=”center”>
<a href=”https://www.mywebsite.com/gallery”><img src=”{g->url href=”themes/matrix/images/newlogo.jpg”}” width=”675″ height=”110″ alt=”New logo for Gallery”/>
</div>
Here you added a link from you Gallery logo. Everytime your visitor will click on the logo it will redirect your visitor to the main Galley page. If you want that it should redirect to your main site home page, then type only <a href=”https://www.mywebsite.com”>.
Now in fact you are almost done. Save this file. Copy this file to the ‘local’ folder (you created earlier) via an FTP program. You can use ‘FileZilla’. You can download it from here:
https://filezilla-project.org/download.php?type=client
Use the FTP program also to copy your logo newlogo.jpg to the matrix’s images folder, that means here
https://www.mywebsite.com/gallery/themes/matrix/images.
Now the last part:
Log in to your Gallery. Go to ‘Site Admin’ then click on ‘Maintenance’. In the ‘System Maintenance’ you will find ‘Delete template cache’, click it, then click on ‘run now’. You are done. Your new logo should appear now as desired.
Cheers!!!
1 comment on “How to change the logo in Gallery2”