Styling RaidTracker
Creating styles
RaidTracker2 can be easy to style. The key to styling your RaidTracker theme is to have everything you need in one location. From where you install RaidTracker, your styles must be in their own directory under /style. Example: If you create a new theme called 'mystyle', the files would be kept under /style/mystyle This will be referred to as your 'style home' below.
What can be kept in your style home? Images, files, javascript, and HTML/CSS/PHP files. However, there are 2 files that are mandatory in order for your style to work. template.php is a must, or else your style will refuse to load. You will also need a file called rt-style.css (We'll get on to other CSS sheets you'll need later)
template.php
This file is a must. Without this file, RT will not use your style at all. This
file controls what is shown from RaidTracker to the browser, and in what order.
template.php has access to the constants of RT which is usually
accessed similar to the following: <?php echo rtw_main;?>
Here are the constants:
- rtw_style : The complete URL to the style home. (e.g. http://www.example.com/rt/styles/mystyle)
- rtw_menu : RaidTracker's menu. This is essentially a list
- rtw_time : The time (if defined). On homepage, this shows the current time. On event view, it will show the start time, end time, etc.
- rtw_message : Any error or relevant message to a function (if defined)
- rtw_news : The breaking news as set in the Admin menu if any is set to show
- rtw_help : Any help messages if defined on certain views.
- rtw_main : The main screen (i.e. Calendar view, List view, etc.) Required to have, or RT will not function.
- rts_guild : Name of the guild
- rts_realm : name of the realm
These constants can appear wherever you want them to appear. Some of these
constants are not always defined (like rtw_message). It is always good to check
if they are defined (otherwise, the constant name will appear instead, and look
awkward). The easiest way is to use something like this:
<?php if(defined(rtw_message)) echo rtw_message; ?>
All of your content will be contained within a body tag, so unless you have any javascript that requires body onLoad or be in the head segment, there shouldn't be any problems.
Stylesheets
RaidTracker's styling comes in the form of stylesheets. The main stylesheet used is a file called rt-style.css. Supplemental sheets, if used, are called rt-style-hh.css (for portable devices), rt-style-ie6.css (for IE6 support), and rt-style-ie7.css (for IE7 users). These additional sheets should only be used to make changes to the original sheet. You may examine the sheet in default to see how the style looks.
One thing to note: tags such as #top, #main, #leftside, etc, are actually defined by the template.php file, and not by RT itself
Using styles
You may set styles at any time in the Administration menu to the stylename. Once submitted, you may have to hit the refresh button, or select any menu option to see it in action.
If you wish to preview or test a style out, you may do so by adding "?style=mystyle" or "&style=mystyle" at the end of the URL. As a FYI, some pages may not work in this manner such as submitting a form or updating status. Most pages, such as viewing an event (with url ending in "?raidid=xx", will work. The "&style=mystyle" allows you to test the style on a one-time basis. When you change views, RT will default back to your default style.