Drupal Theme Generator version 2.0
©2005 by Sam Raheb
November 3, 2005
Designed for use with Drupal versions 4.6.1 or greater
Supports both PHPtemplate and Xtemplate Themes

Features:
• Generate an unlimited amount of site themes for Drupal CMS type websites
• Easily create both PHPtemplate and Xtemplate Themes in minutes
• Supports both flat (non-graphical) and graphic enhanced themes
• Includes META tag support
• Preview your themes on you local computer without having to upload the themes to your Drupal site
• Includes an HTML Color assistant
• Includes 7 graphically enhanced 3D website themes
• Includes a theme development test area
• Easy to use spreadsheet interface

System Requirements:
• Microsoft Excel 2000, 2002, or 2003 with Visual Basic for Applications (VBA) support
• Any Internet web browser

Why developed it?
I have been using Drupal since May 2005 and noticed that there is a short supply of themes available for users. Also, since this time there are very few new themes introduced. It takes quite a bit of time to develop a single new theme, therefore I can understand why. For these reasons, I decided to write a program in Microsoft Excel that generates both the PHPtemplate and Xtemplate Themes based on user design inputs.

Where to get the Program
http://xlecom.com/?q=node/117

Included Themes:

• 3dblue
• 3dbluewt
• 3dolive
• 3dolivewt
• 3dpeach
• 3dpeachwt
• bluemarine2

Contents of each theme folder:

Theme Image files:
b-bottom-center.png
b-bottom-left.png
b-bottom-right.png
b-left-center.png
b-right-center.png
b-top-center.png
b-top-left.png
b-top-right.png
s-bottom-center.png
s-bottom-left.png
s-bottom-right.png
s-left-center.png
s-right-center.png
s-top-center.png
s-top-left.png
s-top-right.png
null.gif
logo.png

PHPtemplate and Xtemplate Theme files:
block.tpl.php
box.tpl.php
comment.tpl.php
node.tpl.php
page.tpl.php
style.css
xtemplate.xtmpl

Other files:
full-screenshot.png
screenshot.png

Note: If you choose the graphically enhanced theme format, you can simply modify the images to get an entirely new look. If you choose use the flat (non-graphical) theme format, the images are not utilized at all.

References
• Red font colored cell are user cells. Enter your data into these cells only.
• Blue and Magenta font colored cells contain formula. Do not edit these cells.
• Black and other font colored cells are description labels.

Instructions:
(1) Enter your initial design variables into the red font colored cells on the Settings sheet.
(2) Design your themes using the utilities on the Design sheet.
(3) Upload the newly created theme file(s) to your web server.

Further instructions are available via the cell comments.

Notes:
The light and dark gray shaded regions on both the Design and Database sheets represent like colors used in the Graphic type themes (if the check boxes are checked). This like color method was used in the sample themes provided with this program. You can however change the colors to any combination you desire.

The "path reference" to the image are saved in the outputted theme files. Therefore, do not share the PHPtemplate and Xtemplate files between theme folders. Use this utility to create theme files for each individual theme. Please use lower case names for all your themes.

Uploading the New themes to your Web Server
This program generates both PHPtemplate and Xtemplate theme files and places them in the active named theme folder To utilize the Xtemplate theme, upload just the xtemplate.xtmpl and style.css files. To utilize the PHPtemplate theme, upload just the block.tpl.php, box.tpl.php, comment.tpl.php, node.tpl.php, page.tpl.php, and style.css files. In either case, you will also have to upload all the theme's support images.

I hope you enjoy this Drupal Theme Design utility. If you do, I would like to know.

Thanks,

Sam Raheb (sam308)
http://xlecom.com

Comments

matteo’s picture

Sam,
really good job, but it seems that the cell where you select the theme is password protected....
Is this an error ??

I'm using Excel 2003

Matteo

Sam308’s picture

Matteo:

Thanks for pointing this out.

I found the problem.

It was an issue inherent with "Excel 2003". The program was written in Excel 2000 and this problem did not exist. I just fixed it and uploaded the fixed version.

The fixed version is now version 2.1 and is available for download at http://xlecom.com/?q=node/117

Sam

dado’s picture

Sam,
Many thanks for all your hard work!

I also have the problem with protected cells.

dado
http://schtickdisc.org

dado’s picture

Sam,
You must have posted your reply just as I posted my comment. I am also using Excel 2003. I downloaded version 2.1, and I still get the password when I try to unprotect (tools -> protection -> unprotect sheet).

Thanks
dado
http://schtickdisc.org

Sam308’s picture

Dado:

The protection issue and fix was only for the drop-down list in the first cell of the “Theme Values” column.

The sheet(s) are supposed to be protected so that the integrity of the program stays intact. The program was designed to function properly with the sheet protection.

Differences in Excel versions:
This program was written in Excel 2000. Since Microsoft is always changing the functionality of Excel with different released versions, functionality of this Drupal Theme Generator program may vary depending on what version of Excel you are using. The sheet(s) within the program are supposed to be protected so that the integrity of the program stays intact. The program was designed to function properly with the sheet protection. If you experience any "functionality" type issues, then please let me know so that I can make compatibility changes for all versions of Excel.

The following are guideline references:

References
• Red font colored cell are user cells. Enter your data into these cells only.
• Blue and Magenta font colored cells contain formula. Do not edit these cells.
• Black and other font colored cells are description labels.

For Your Information:
This program was developed using both the Bluemarine PHPtemplate and Xtemplate themes as the master templates.

Sam

dado’s picture

Sam,
Sorry for my cryptic reports. Let me try again.

In the design area, when I click on the "test" cell, in the "Select the cell to choose a theme name from the list" row, I cannot change from "test". I get "The cell or chart you are trying to change is protected and read-only...". Maybe the way it is supposed to work. But if so, I do not see how I can create new themes that are not called "test".

Also, do you have a way of importing other pre-existing themes or must these be hand entered?

This app is really cool, and has the potential of revolutionizing Drupal theming. Again many thanks
dado
http://schtickdisc.org

Sam308’s picture

This is yet another Excel 2003 difference (flaw).

This Issused has now been fixed !!

Download the new "fixed" version 2.2 at:
http://xlecom.com/?q=node/117

As far as importing themes, there is no import routine.

This program was developed using both the Bluemarine PHPtemplate and Xtemplate themes as the master templates. Therefore, your new themes are based on these models. The design parameter you change basically modify these templates to create a new theme.

Sorry,

Sam

matteo’s picture

Sam,
now it seems all working now, I'll take a closer look a it in these days.
thanks again for your 'jewel'.
I'm advertising it on my site 'http://www.drupaitalia.org'....

CIAO

Matteo

Sam308’s picture

Matteo:

Your Welcome !

BTW: the url you stated, http://www.drupaitalia.org/ should be http://www.drupalitalia.org/.

Anyways, Thanks again and take care,

Sam

Sam308’s picture

Should I release the source code for the Drupal Theme Generator Program?

I would like to know if anyone in the Drupal Community may be interested in building upon the Drupal Theme Generator?

If I find there is a “genuine” interest of enhancing the program as an open source project, then I will consider making the programming source code publicly available.

I have invested a good amount of time in developing a solid foundation for the program, programming it in such a way of allowing someone else to add his or her own creative enhancements to the program.

Does the following description of the functionally of the program interest you?

Most programs typically output results that are static. In the case of the Drupal Theme Generator program, the program outputs actual programming code to be used by other computers. Thus can be said the output is static but is used in a dynamic environment.

The program primarily functions by taking user input and running it through a series of IF-THEN formulas placed in strategic “line code” locations on multiple spreadsheets. The calculated result is a custom set of HTML, php, and CSS code blocks, which are then outputted as individual theme files to your local computer. These theme files are then uploaded to a web server and interpreted by the site’s’ theme engine to render the final theme to your web browser.

If you are familiar with writing formulas in Microsoft Excel and know how to write VBA modules, then this endeavor may be right for you. Keep in mind that all work preformed on this program must be open source and publicly available.

If this challenge appeals to you, then please respond to this posting.

Thank you for your time,

Sam Raheb (sam308)
Drupal Theme Generator Program Developer

wellsy’s picture

I have used Microsoft Excel in a different but in some respects similar fashion for years now to generate the static html pages on my website at www.orchidsonline.com.au in the old photos area and the society and business lists.

I have looked at your spreadsheet and must congratulate you on a very fine piece of work which at a glance I can see "you have invested a good amount of time".

If I had the time I would be very happy to take up your challenge but at present I am flatout trying to juggle a "real" job and the development of my own new drupal powered area plus another major website upgrade for a bookseller customer.

The development of a series of compatible, attractive themes for my drupal site is one of the major priorities at present so I will be using your spreadsheet for that at least. Thanks!

What sort of development work do you have in mind for the spreadsheet?

In what sort of timeframe would you like to see results?

What level of VBA knowledge is needed?

wellsy

orchidsonline.com.au

Geary’s picture

I haven't tried out the new theme generator yet, but I'm sure when I do I'll find something I would like to tweak. :-)

I can't promise I'll spend a lot of time on it, but I can probably make some little improvements here and there. So if you are willing to release it as open source that would be great.

StevenSokulski’s picture

I am using this on Excel 2004 for Mac and am not able to change the File Save Location. Without the ability to do this I cannot Preview or Create any files. Is this a compatability issue with Mac?

Looks great so far though...

Sam308’s picture

Remember the blue font colored cells contain formulas that are not meant to be changed. You only change the values in the cells with red colored fonts.

All you have to do is change the path location on the Settings sheet (Drupal Theme Designer directory path) and not on the Design sheet. The path on the Design sheet (File Save Location) is determined by the path entered on the Setting sheet.

Cell Comments
The cell comments should explain everything and include instructions on how to use the program. You should be able to view them by hovering your mouse over the cells that have a red colored triangle in the top right corner. These comments will appear as popup comic book type comments in yellow colored boxes.

Sam Raheb

hadishon’s picture

Can you import exsisting themes into the database? I moved a theme package into the theme directory but the database doesn't reconize it.

Thanks,
Michael

Sam308’s picture

The program was not designed to import existing themes.

The only thing you can do is to identify the colors used in your existing theme and create a new theme using your existing theme colors. If your theme uses border graphics, then enter the names of the images used in the Settings sheet.

The cell comments should explain everything and include instructions on how to use the program. You should be able to view them by hovering your mouse over the cells that have a red colored triangle in the top right corner. These comments will appear as popup comic book type comments in yellow colored boxes.

This program was developed using both the Bluemarine PHPtemplate and Xtemplate themes as the master templates. Therefore, your new themes are based on these models. The design parameters you change basically modify these templates to create new themes.

Sam Raheb

stevryn’s picture

When using Firefox, the graphical versions are messed up with the themes, at least in my case. the "boxes" are broken up, so you only see the corners ..any ideas on how to fix? most of my people use firefox..

This is awesome though thanks for all your hard work on this!!

T

Sam308’s picture

I initially designed this program using Microsoft Internet Explorer 6.0

I just installed the Firefox web browser and I can see the problem.

The problem is inherent with Firefox !

If you installed the Web Developer extensions and Outline the table cells, you can see the problem appears in the last row of each graphic table. See the code below:

<!-- BEGIN: block -->
<table border="0" cellspacing="0" cellpadding="0" style="width: 100%;" class="blk">
 <tr>
  <td><img src="/themes/test/s-top-left.png" alt="" style="display: block;"></td>
  <td class="s-topcenter" style="width: 100%;"><img src="/themes/test/null.gif" alt=""></td>
  <td><img src="/themes/test/s-top-right.png" alt="" style="display: block;"></td>
 </tr>
 <tr>
  <td class="s-leftcenter"><img src="/themes/test/null.gif" alt=""></td>
  <td class="menutitle" style="width: 100%; vertical-align: top;">{title}</td>
  <td class="s-rightcenter"><img src="/themes/test/null.gif" alt=""></td>
 </tr>
 <tr>
  <td class="s-leftcenter"><img src="/themes/test/null.gif" alt=""></td>
  <td class="menuspace" style="width: 100%;"><img src="/themes/test/null.gif" height="2" alt=""></td>
  <td class="s-rightcenter"><img src="/themes/test/null.gif" alt=""></td>
 </tr>
 <tr>
  <td class="s-leftcenter"><img src="/themes/test/null.gif" alt=""></td>
  <td class="block block-{module}" id="block-{module}-{delta}" style="width: 100%;">{content}</td>
  <td class="s-rightcenter"><img src="/themes/test/null.gif" alt=""></td>
 </tr>
 <tr>
  <td><img src="/themes/test/s-bottom-left.png" alt="" style="display: block;"></td>
  <td class="s-bottomcenter" style="width: 100%;"><img src="/themes/test/null.gif" height="1" alt=""></td>
  <td><img src="/themes/test/s-bottom-right.png" alt="" style="display: block;"></td>
 </tr>
</table>
<!-- END: block -->

Continued below because Drupal.org character limit on postings

Sam308’s picture

(Continued from above)

Firefox is automatically taking the "undefined" height properties of the graphic border images of first row and propagating it to the last row.

The first row border images are 18 pixels in height.
The last row border images are 10 pixels in height.

Firefox is using the 18 pixel "undefined" height for the last row which should be 10 pixels in height.

You can see an illustration of this Firefox error in the following image:

http://xlecom.com/assets/images/firefox-table-problem.gif

I even tried to modify the last row in the table by specifying a height of 10 pixels for both the images and table cells, but Firefox rejects the 10 pixels height and still makes it 18 pixels high.

You can fix the problem for now by increasing the size of bottom border images from 10 pixels to 18 pixels.

In other words, with Firefox both the top and bottom border images must be the same height.

Anyways, I will try to see if I can find a work-around for this Firefox problem.

Sam Raheb
(sam308)

Sam308’s picture

Drupal Theme Generator Source Code
Version: 2.2
©2005 by Sam Raheb
Released: November 18, 2005
Designed for use with Drupal versions 4.6.1 or greater
Supports both PHPtemplate and Xtemplate Themes

More information: http://drupal.org/node/38138

Sam Raheb (sam308)
http://xlecom.com