About osDate Templates
Return to the Index
This file isn't about the Smarty template engine; you can read about that here. It's about the osDate "themes", like "default-blue" and "black-grey": how they work, and how to add new ones. osDate theme/template files have the .tpl extension, and are found in the "templates" folder. These files contain only HTML, Javascript, and Smarty template code, but no PHP code. You should not modify the PHP files that come with osDate when adding new themes.
The "templates" folder of osdate has several folders in it, including "current", "pages", and several themed folders, like "black-gray". Here's what they mean.
"current" = This is the currently-loaded template. When you change the template using the Global Site Settings admin tool, two things happen:
1. All files from the "default-blue" folder are copied into the "current" folder.
2. The .tpl files from the selected theme are copied into the "current" folder, overwriting any existing .tpl files of the same name.
"pages" = This contains template files for parts of the osDate system that do not belong to any specific theme.
"default-blue" = This contains the default .tpl files. When you change to any theme, like "black-grey", most of the files from "default-blue" are actually used, and the .tpl files from the chosen theme overwrite the default-blue files when copied into the "current" folder.
Adding a New Theme
Adding a new theme is as easy as creating a new sub-directory in the templates folder, then copying the "default.css" file from any current template folder into this new folder, and finally creating sub-folders called "admin" and "images" in the new template folder. For example, to create a new template called "techno" I would create a new directory structure like this:
If you login to the admin section of osDate, then click on the Global Site Settings tool, you should now see this new template in the "Site Theme / Skin" combo list.
When you change to the new theme, it should look exactly like the default-blue theme, except that it will use the default.css file from the theme that it originally came from. For any .tpl file that you would like to customize for your new theme, copy the .tpl file from default-blue to the new template folder ("techno" in this case), then customize it as needed using any good text editor. I recommend Textpad.
The reason for using this method is that you'll now be able to add new templates very quickly, without requiring that every .tpl file be present. The system essentially "fills in the blanks" of any missing .tpl files, by copying them from default-blue. You'll probably wish to create unique images for your new template, and use unique CSS settings. If you want to really change the layout in significant ways, you'll probably want to change the "index.tpl" and "homepage.tpl" files as well, and possibly other .tpl files. Keep in mind that the more .tpl files you change, the more difficult it will be to maintain as new features are released for osDate.
Editing an Existing Theme
To edit an existing theme, first change to the theme in the Global Site Settings, then edit the .tpl files in the "current" folder as appropriate. Then, when you are satisifed with how the theme looks, copy only the .tpl files that you changed back into your new theme folder.
Be very careful that you save the changed .tpl files from the "current" theme before changing the theme again in the Global Site Settings. Otherwise, you'll overwrite the "current" directory files and lose any changes that you made.
Good luck!
Darren