Hi,

I have a static site that I want to move to Drupal. I have Drupal 4.7 up and working, and I now need to look at moving my site over. The content itself is not a problem, as I plan to use this as an excuse to re-do the content from scratch. However, I have absolutely no idea how to move my design over to a theme in drupal.

Fortunately its mostly CSS based and theres only a small amount of HTML in the form of DIV tags.

So, are there any simple guides on how to move my site design to a theme in Drupal ??

Lost from England.

:)

Comments

robertgarrigos’s picture

Your first move would be looking at the handbooks: http://drupal.org/node/257

Then use one of the themes served with drupal as the base for your own theme. A phptemplate theme would be a good start (the ones ending with .tpl.php). There are some that use div tags and mostly css like yours. It shouldn't be diffcult to fit it to your needs.

---
Robert Garrigos
Professional site: robert.garrigos.org
CATdrupal - Catalan Drupal Users Group: groups.drupal.org

Max Bell’s picture

In the interest of full disclosure, I should point out that I should not be giving theming advice to garden slugs, as after almost six years, my attempts at theming have been so awful that, when I can finally admit to myself that my latest effort displays all the design sense of a color blind golfer's wardrobe and the usability of a ladder made of sturdy spaghetti, I delete every them on my site except for Bluemarine and set it as default. I have not turned on the Drupal module in years, for fear that someone might actually discover my site and note how often I am complimented for my improved ability when the default theme suddenly changes again.

That said, the "RTF(riendly)M" advice is meant in earnest, especially if one hasn't had occasion to learn theming before. With respect to the fact that Smarty has been around for a while and enjoys the support of being available for other CMS' and the like, I've never actually looked at it, being wholly biased in favor of PHPTemplate, which was the first theming system I'd ever been able to make use of without causing myself injury.

But the short answer, besides what's in the handbook, is that everyone first learns to theme by finding a theme someone else has already written and modifying it. If you're already comfortable with the idea that, in a general way, the typical setup is a header, a footer, some content and a sidebar or two with blocks in them, then the contents of the php script files that a theme is made up of is more or less a collection of blocks and divs, with the php code that determines what should be displayed in those different areas nested in the middle. Beyond that, the sole concern is being able to distinguish between the elements that belong to the theme and those that belong to other parts of drupal or the contributions that have been added on to it. and knowing this, you can substitute your own naming conventions for elements for the ones in the php files. Provided you don't accidentally remove a bracket or part of someone's array from the code (because themes are surprisingly touchy about these things, in spite of generally being well mannered the rest of the time), the only other thing there is to worry about is the urge to style one's pages directly in the scripts instead of in a CSS file, or adding code that might later end up making the theme easier to start over from scratch rather than updated in order to remain compliant with changes in the core theme system.

It sounds complicated, but its just hunks of code that spit content into various page elements. If you can create a multi-column page in CSS to control the display of an HTML document, then the addition of a scripting language for dynamic HTML shouldn't throw you off too much.

On the other hand, you should also take this with a grain of salt since I have no idea at all what I'm talking about and my medication dosage has been trippled ever since attempting to come up with a theme for PHPNuke all those years ago. So if your question falls through the cracks and someone who knows what they're doing doesn't reply, just repost your question, trying to be as specific and detailed as you can and including what you've gotten from the handbook thus far, and know that your patience and good nature are even more appreciated when a new version of the core has entered the last couple weeks of testing.