Drupal Theme Generator Version 2

Drupal Theme Generator version 2.2
©2005 by Sam Raheb
November 4, 2005
Designed for use with Drupal versions 4.6.x
Supports both PHPtemplate and Xtemplate Themes

A newer version is now available. Please go here

Download the Program

The Single File Download, Drupal Theme Generator 2.2.zip, is for those who already downloaded version 2.0 or 2.1. I had to fix a cell protection bug that was inherent to Excel "2003". If you did not previously download version 2.0 or 2.1, then download the "Full version 2.2 Download" (1.58 MB).

Drupal Theme Generator Source Code
The source code file contains the source code for the Drupal Theme Generator. It is the same Excel (xls) file as above without the sheet protection and with all sheets visible. I am releasing the source code in the hopes that someone in the Drupal Community may be interested in building upon the Drupal Theme Generator and rereleasing it to the Drupal Community. You can Download the Drupal Theme Generator Source Code Excel file here >> Drupal Theme Generator Source Code

More Information - Features and Instructions

You must login to post any comments, Thank you

Quirks Mode Primer - Changes to the code

Tom:

Below are sections of code extracted from the three themes files: style.css, Xtemplate.xtmpl, and phptemplate page.tpl.php used in the Drupal Theme Generator program. These code sections are the sections of code in question regarding the Quirks Mode Primer subject discussed previously. If you can you tell / show me what needs to be done, I can make the changes to the Drupal Theme Generator program.

Topic 1: Regarding the first lines of code in these files.
Below are the first lines of code in each of the corresponding files. Do I need to change / modify / remove any of the code in these lines to make the themes "Standard Mode" compliant? If so, can you tell / show me what needs to be done?

    style.css file contains:
    /* $ Generated by the Drupal Theme Generator ver. 2.2 developed by , November 2005 $ */
    /* $Id: based on style.css,v 1.7 2005/03/05 14:34:39 unconed Exp $ */
    /*

    Xtemplate.xtmpl file contains:
    <!-- Generated by the Drupal Theme Generator ver. 2.2 developed by , November 2005 -->
    <!-- BEGIN: header -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="{language}" xml:lang="{language}">

    phptemplate page.tpl.php file contains:
    <!-- Generated by the Drupal Theme Generator ver. 2.2 developed by , November 2005 -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language ?>" xml:lang="<?php print $language ?>">

Topic 2: Regarding the Box Model
Below are the sections of code in each of the corresponding files that relate to the Box Model / wrapper topic you discussed previously. Do I need to change / modify / remove any of the code in these lines to make the themes "Box Model / wrapper" compliant? If so, can you tell / show me what needs to be done?

    style.css file contains:
    #search .form-text, #search .form-submit {
      border: 1px solid #369;
      font-size: 1.1em;
    }

    #search .form-text {
      width: 8em;
      height: 1.4em;
      padding: 0 0.5em 0 0.5em;
      margin: 0 0 0.5em 0;
    }

    #search .form-submit {
      height: 1.5em;
    }

    #sidebar-left, #sidebar-right {
      background-color: #FFFFFF;
      width: 16em;
      /* padding in px not ex because IE messes up 100% width tables otherwise */
      padding: 0px;
      vertical-align: top;
    }

    Xtemplate.xtmpl file contains:
         <form action="{search_url}" method="post">
           <div id="search">
             <input class="form-text" type="text" size="15" value="" name="edit[keys]" alt="{search_description}" />&nbsp;<input class="form-submit" type="submit" value="{search_button_text}" />
           </div>
         </form>

       <!-- BEGIN: blocks -->
       <td id="sidebar-left">
         {blocks}
       </td>
       <!-- END: blocks -->

       <!-- BEGIN: blocks -->
       <td id="sidebar-right">
         {blocks}
       </td>
       <!-- END: blocks -->

    phptemplate page.tpl.php file contains:
         <div id="secondary"><?php print is_array($secondary_links) ? theme('links', $secondary_links) : "" ?></div>
         <div id="primary"><?php print is_array($primary_links) ? theme('links', $primary_links) : "" ?></div>
         <?php if ($search_box) { ?><form action="<?php print $search_url ?>" method="post">
           <div id="search">
             <input class="form-text" type="text" size="15" value="" name="edit[keys]" alt="<?php print $search_description ?>" />&nbsp;<input class="form-submit" type="submit" value="<?php print $search_button_text ?>" />
           </div>
         </form><?php } ?>

       <?php if ($sidebar_left) { ?><td id="sidebar-left">
         <?php print $sidebar_left ?>
       </td><?php } ?>

       <?php if ($sidebar_right) { ?><td id="sidebar-right">
         <?php print $sidebar_right ?>
       </td><?php } ?>

Thank you for your time,

Sam Raheb
XLEcom Program Developer

How to design new layout themes

Hi Sam,

I like Drupal Theme Designer, but I like to know if it is possible to manage layout of themes. I like to change (redesign of existed layout) Graphic Header,Graphic Sidebar Blocks or Graphic Footer Area. And my second question is why I can not see themes in Excel cell "Select the cell to choose a theme name from the list", I have copied in folder themes . Is it posssible just to redesign only included themes and if not how to import or create a total new themes. I think this things are possible, but I don know how to do it.

Can you advise me?

Thank you,

Borislav

RE: How to design new layout themes

Borislav:

Download the Drupal Theme Generator Source Code so that you can change the design layout of the themes. Examine the xtemplate and phptemplate sheets so you understand how the themes are constructed. You can reposition and manipulate the code to give you a different look for the Graphic Header, Graphic Sidebar Blocks and Graphic Footer Areas.

Most of the formulas in the cells are IF-THEN conditional formulas. In most cases, if the value of the condition is false, then the result will be a blank value represented by double quotes "". Cells which are evaluated as "" cannot be visually seen on the spreadsheets. Therefore, be careful when editing the sheets. To toggle a view the cell formulas in all of the cells on a spreadsheet, independent of their calculated values, hold down the use the Ctrl key and press the ` key. The ` key is to the left of the #1 key.

You can modify the themes included with the program, but the program does not support importing of existing themes.

As far as the "Select the cell to choose a theme name from the list" question is concerned, you should be able to select the drop down list in both the first cells of the Theme Values and Design Values columns on the Design sheet. These two drop down list are linked to the Themes on the Database sheet.

Program Developer

Sam Raheb
XLEcom Program Developer

Redesign layout of the themes

OK Sam,
thanks for your quick replay. I will download Drupal Theme Generator Source Code and try to change the design layout of the themes.

Best Regards

Borislav

Images

Hello Sam,

Excellent Program.

I've uploaded the sample themes to my server as a test ... but the images do not show. Instead, the box w/red X displays.

All of the images have been uploaded w/theme folders. I'm using PHPtemplate ... not xTemplate and have uploaded the proper files as per your instructions.

Can you advise?

Thank you,

Laurie (MamaB)

RE: Images

Laurie:

This seems like a path problem.

Before you press any of the "Create" theme buttons makes sure you first set the "File Save Location" by selecting a theme using the drop down list box in the" Design Values" column on the Design sheet. This is the first cell under the "Design Values" column, cell E11. Now when you create the themes, the correct path will be written to the files. This also applies when you press the "Save Theme to Database" button.

You can see the active "File Save Location" at the top of the list in cell D4.

Take care,

Program Developer

Sam Raheb
XLEcom Program Developer

One More Question ...

Hello Sam,

Thank you. You make my life so much easier. I'm trying to teach myself how to build websites ... I'm sure you can imagine the time I have.

If I may bother you for one last question.

You say in order to change the colors of the theme - to just modify the images. I'm sure I can do this ... but there is more than likely a quicker and much easier way.

Can you tell me what program these images are created with - and the most efficient / effective manner in which to change the color?

Normally, I would play around with them until I figured out a way to do it ... but then, I learn the "right" way and I'm irritated at myself for taking 3 days to so something that could have taken me only 3 minutes.

So this is why I'm asking a question. I appreciate any advice / tips ...

Thank you again - for a wonderful tool!

~ Laurie (MamaB)

RE: One More Question ...

Laurie:

You can change the "colors" of the theme by changing the color codes on the spreadsheet.

The theme images are not required for the creation of a theme. However, they can be used to enhance the look of the borders that surround the content of the site.

If you want to "optionally" include images in the theme for a graphic type look, then you can edit the colors or design of the border images using an image-editing program such as Paintshop Pro.

For Example - Editing the sample images provided with the program.

The simplest way to change "just" the color, but leaving the 3D look untouched, is to perform the following steps:

(1) Using your image editor, open "all" the sample images from within a single theme directory.

(2) Alter the Hue/Saturation/Lightness properties of each image to obtain a new color. Remember to also retrieve the HEX code for the new color by using the color ID tool. You will need this color value for the editing the colors in the spreadsheet.

(3) Save all the image files (There is no need to change the file names)

(4) Edit the color codes in the spreadsheet program to match and accent the new image color change you made via the Hue/Saturation/Lightness process.

This is how I created the three (3) different colors for the sample themes. I just created one set of border images and then changed the Hue/Saturation/Lightness properties to create the three different colored themes.

I hope this helps you.

Good luck and take care,

Program Developer

Sam Raheb
XLEcom Program Developer

IS it possible

I would love to use this but it seems not to work outside of windows. I run Linux gentoo and I can use open office to work with the theme generator but it does nothing when it comes to saving it or previewing it. I know I'm like the only one that would even ask this but I'd love to see it work on linux aswell, thanks for your time.

Punisher

RE: IS it possible

This program uses VBA macros in Excel. I don't know if they would run under Linux. This program was designed in Windows XP and Excel 2000.

Sorry, but I can't offer any solutions outside of the Windows environment. I only have Windows and not Linux.

Program Developer

Sam Raheb
XLEcom Program Developer

Drupal Theme Generator

Hi Sam,

I have just been experimenting with the DTG. I am using excel 2002 & have just fixed the problem with the locked out (protected) themes by downloading the 2.1 version of the database.

I can now select a different theme. Unfortunately, when I go to, Preview Theme, the theme is not updating & remains at the default colours & layout. Also the page partitioning borders (which I think you refer to as sidebars) are missing, although the corners are present.

I have tried to rectify this problem without success, have you any ideas?

Thanks,
Alan.

RE: Drupal Theme Generator

Alan:

Download version 2.2. This should fix the problem.

Make sure you FIRST set the directory path on the Settings sheet (cell C5) before you attempt anything..

Let me know if version 2.2 fixes the problem.

Program Developer

Sam Raheb
XLEcom Program Developer

DTG

Hi Sam,

Sorry, I did not realise you had to press, "Send to", to transfer a theme into the working area. I can see why you have done this - to allow the design of a theme by modifying an existing proven scheme, which can obviously save a lot of messing around.

The fault with the incomplete borders (what I think you are calling enhanced graphics) is still present but I have traced the problem to my browser which is a beta 1 version of the latest firefox browser. When I use IE it came up fine.

There is a problem with cell 5 on settings in that I cannot modify the last part of the saving path properly. I would like to create a fresh design in a folder, which I have placed in themes (alongside, "test" etc) called, "my theme". But in design view cell d4 is coming up with the test folder tagged onto the end of it.

This is a very good program but I think it needs a bit more documentation to help it along. The average person (such as me) may struggle & give up. For instance, it could be made clearer that it is only necessary to upload a HTML or a PHP version of the template but not both & that doing so would result in both file types being in the upload folder. This is not a problem of course as you can select the right ones as needed but again this needs explaining.

Thanks Alan.

RE: DTG

Alan:

To properly view the active themes between theme previews, you "should", clear your browser's cache, depending on your browser you use. If you do not clear the browser's cache, you may only see the properties of the previous theme preview.

The "Drupal Theme Designer directory path" cell C5 is an editable cell. When I want to change the path, I just copy the path from a Window's folder's address bar, switch back to Excel, select cell C5, and paste the path into formula bar and hit the Enter key. That's it.

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.

From my experiences, if you upload both the phptemplate and xtemplate files, the phptemplate theme takes prevalence.

Program Developer

Sam Raheb
XLEcom Program Developer

Very nice Job !!

Very nice job, but it seems that the field used to select the theme is password protected...

Is it a mistake ???

thanks,

Matteo

RE: Very nice Job !!

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.

Program Developer

Sam Raheb
XLEcom Program Developer