|
The following document is a set of guidelines for writing skins that DiscusWare can distribute through the template gallery. The template gallery is integrated into the Appearance Manager for Discus 4.0 and higher, making it very easy for board administrators to install skins. In addition to making the skin distributable, these hints will make it easy to take customized skins with you should you ever need to move your board, or to implement the skin onto multiple boards.
1. Do not hard-code URLs.
Write all URLs in terms pertaining to the Discus board in terms of $html_url and $script_url. These variables can be used anywhere in the template and will be replaced with appropriate values from the discus.conf file. Should you ever need to move your board to another site, you won't have to update your skins if you use variables.
2. Centralize icons.
If you use any non-standard icons (not distributed with Discus), we suggest that you create a subdirectory within the "icons" directory to hold your customized icons. For example, if your skin was named "myskin" then you should create a directory called "myskin" under "icons" and put your icons there.
If you follow the above guideline, you can then use the following variables to refer to your customized icons:
- $skin_icon_url (replaced with, e.g., http://your.server.com/discus/icons/myskin)
- $skin_icon_dir (replaced with, e.g., /etc/httpd/html/discus/icons/myskin)
This also makes any customized icons very easy to find should you need to move servers or use your skin on other Discus boards.
3. Avoid relative URLs.
Since skin-generated screens are found at many different URLs, the use of relative URLs should be avoided. For example, say you used the code <img src="../myimage.gif">. This HTML may work properly if you are reading message pages and "myimage.gif" is in the "messages" directory. However, the link will be broken if you are looking at the topics page, a utility screen, or a private reading topic. Use $html_url and $script_url wherever possible.
4. Avoid making new language.conf entries.
If you need new text in your skin, we suggest putting it directly in the skin, rather than using $L{} variables and adding to the language.conf (or lang40.conf) file. The reason is as follows: should you need to upgrade your board, move to a new server, or redistribute the skin, you will need to customize or re-customize the language.conf file.
|