3 <title>GForge Themes HOWTO</title>
8 <h2>GForge Themes HOWTO</h2>
9 <h3>Updated 12/30/02</h3>
12 <p>Let's say you want to create a new theme called "water". It'll be
13 all blue-ish and clean and such.</p>
14 <p>First, create a new directory <code>www/themes/water</code>. This
15 is where your new theme will live. Now, write a PHP class called <code>Theme.class.php
16 </code>that extends <code>www/include/Layout.class.php</code>. Like this:</p>
18 class Theme extends Layout {
19 require_once('www/include/Layout.class.php');
22 $this->COLOR_HTMLBOX_TITLE = '#BBDDFF';
27 <p>Note that we've made the box title color to a nice blue just so
28 we can see something happen. To make the theme available, we need to add
29 it to list of available themes. To do that, log in as the admin user, go
30 to the admin page, click on Add, Delete, or Edit Themes, click on
31 add_new, and add the new theme. On this page you'll see listed the
32 column names in the <code>themes</code> database table. You can see if
33 you already have any custom themes installed by querying the database,
36 bash-2.05a$ psql -c "select * from themes;" alexandria
37 theme_id | dirname | fullname
38 ----------+---------+----------
44 <p>So, we don't have any custom themes installed, and we can enter a
45 <code>theme_id</code> of <code>1</code>. The <code>dirname</code> will
46 be <code>water</code> and the <code>fullname</code> is <code>Water</code>.
47 Then click the Submit New Theme button and it'll be added, which you can
50 bash-2.05a$ psql -c "select * from themes;" alexandria
51 theme_id | dirname | fullname
52 ----------+---------+----------
59 <p>Now go to the Account Maintenance page and click on the Choose My
60 Theme link. Select the Water theme and click Submit Changes. Then click
61 on My Page and, if all goes well, the box title bars will all have blue
62 backgrounds. Nice, huh?</p>
65 <p>There's an example of a Layout subclass <a
66 href="http://savannah.nongnu.org/cgi-bin/viewcvs/gforge/gforge/www/themes/debian/Theme.class.php?rev=1.8&content-type=text/vnd.viewcvs-markup">here</a>.
74 <li>Changing other stuff seems to require copying the
75 gforge/Theme.class.php file over and customizing it - i.e., editing the
76 CSS stylesheet to do what you want, changing the image root, etc.</li>
77 <li>Need to include list of images with details from Ryan's post.