Hi. This is, in essence, an answer I wrote recently for the spanish forum, about theme building. It might be useful here, so I made this translation. I added some stuff, the text between brackets [].
1)
XOOPS2 does actually ease the handling of themes because, unlike other systems, which assemble pages using page segments (the header and the left navigation in one file, the right navigation and the footer in another, and the content modules in the center), in
XOOPS2 you have a single HTML file (
theme.html), and you write inside the code variables and conditional tags to define what's displayed to the final user. Having the theme page in a single file certainly makes the job easier.
2) Let me see if I can "define" the difference between
templates and
themes. We might say the theme is something like a "skin", that is,
a theme conveys the visual solution of a site. On the other side, a template solves the relation between the theme and the data kept in the database:
the template defines what variables to get under what conditions. In
XOOPS2 RC3 this is assembled as follows:
a) The theme (basically, the theme.html file, the global images and the stylesheets) are kept in a folder, to facilitate their modification and upgrading.
b) The templates, that also exist physically as files, are kept in the system within the database. I've found that in order to change a template, the best way to do it is to try your changes in an external file. Once you've solved the basic stuff, look forthe template file (as administrator), paste the template code in the textarea, run tests and then work in the fine detail until things display the way you want.
c) The system has other files, more tied to the programming logic than to the presentation, but sometimes you have no other choice but to open them. Basically they're
PHP files that configure the assigning of variables (remember, this works with
Smarty) and the access to the database. The less you mess with this files, the better.
3) Editing a theme is absolutely easier if you have in your PC a web server. That's the way I do it: I have a complete environment with Apache friend's
WAMPP (Apache, PHP, MySQL, etc.) and I run everything locally first. Once you complete your theme, you export it to a
tar.gz file, and you can upload that file to your public web server. Obviously there are things to arrange (watch for paths, images and other included files), but as a general rule it's easier to develop locally and upload once you have ironed out most of the bugs. NOTE: Most of the nice things you won't be able to see using
Dreamweaver (or
GoLive, or
FrontPage), because of the simple fact that pages are built dinamically; this means you can see the
skeleton of your theme, but not the actual output with real content. [This is particularly true if you design your pages using
positional CSS, because all of these tools do a poor job when rendering DIVs.]
4) You've been told about the difference between the various stylesheets. I'll just add the fact that having three files allows you to be very precise in the display for three very different worlds: the generic world of MSIE and other like browsers, the new Netscape world (versions 6.2 and above; nothing here applies for versions 4.76 and before), and the world of Macintosh computers.
5) To develop a theme, I'd guess the most useful strategy --or at least the one I'd recommend-- is to take a very deep look at an existing theme of your choice [
and everyday the paper boy brings more...], let's say the default theme or the X2T theme. Once you grasp how the page is made, you'll understand why I say: want a theme? Create it from zero --but using your favorite theme as a guideline.
6) And last but not least, the difference between
modules and
blocks is fundamental.
A module is a complete subsystem that deals with the management and display of one type of content. For instance, the FAQ module lets you manage the frequently asked questions (add, edit, delete) and also lets you define the way the FAQs will display within your site.
A block is like the expression of a module in the site. This expression comprises both the data shown and the styling used to display the data. So, we might say that both modules and blocks are programmed. not designed; you design the theme to describe, at the very least the general displaying frame used in the site; then, and this is optional, you extend your design philosophy to whatever templates you'd like to change.
I know these are generic answers, but I hope they at least point you in the right direction.
Greetings from México.
BTW: if you want to see what I have done following the steps described here, take a look at the beta of my site in
Punto flotante.