Project

General

Profile

Howto add a logo to your Redmine banner » History » Version 10

Peter Englmaier, 2011-11-22 10:37
Links should include sub_URI for redmine installation

1 6 Mischa The Evil
h1. HowTo add a logo to your Redmine banner
2
3
You can very easily add a logo to your Redmine banner by modifying your base.rhtml file.
4
Big thanks to "Chris Miller":/users/758 for showing me how to accomplish this :)
5
6
Note: This has been tested using the Squeejee Theme and the Classic Theme.
7 9 Vojtěch Horký
Note2: if you used apache2 passenger module to install redmine,the location of redmine should be @/usr/share/redmine@ instead of @/opt/redmine@
8 1 Aaron Johnson
9 9 Vojtěch Horký
*Edit your @base.rhtml@ file*
10 6 Mischa The Evil
11
Example:<pre>
12
nano /opt/redmine/app/views/layouts/base.rhtml</pre>
13
14
Find this line:<pre>
15
    <h1><%= page_header_title %></h1></pre>
16
17
And change it to:<pre>
18
     <!--<h1><%= page_header_title %></h1>--></pre>
19
20
Add this line directly below:<pre>
21 10 Peter Englmaier
     <img src="<%= Redmine::Utils.relative_url_root %>/images/logo.png" style="top-margin: 15px; left-margin: 15px;"/></pre>
22 1 Aaron Johnson
23 10 Peter Englmaier
The ruby statement @<%= Redmine::Utils.relative_url_root %>@ will produce the relative URI for your redmine installation.
24
25
26 6 Mischa The Evil
Now it should look like this:<pre>
27
    </div>
28 1 Aaron Johnson
29 6 Mischa The Evil
     <!--<h1><%= page_header_title %></h1>-->
30 10 Peter Englmaier
     <img src="<%= Redmine::Utils.relative_url_root %>/images/logo.png" style="top-margin: 15px; left-margin: 15px;"/>
31 6 Mischa The Evil
32
    <% if display_main_menu?(@project) %></pre>
33
34
*Upload your logo*
35
36
Example using the scp command:<pre>
37
scp logo.png root@example.com:/opt/redmine/public/images</pre>
38
39
You probably should chown the uploaded logo:<pre>
40
chown redmine:redmine /opt/redmine/public/images/logo.png</pre>
41
42
*Restart your web server*
43
44
Examples:<pre>/etc/init.d/apache2 restart</pre><pre>/etc/init.d/httpd restart</pre><pre>/etc/init.d/nginx restart</pre>