Hello everbody,

I create this post because I'm confused, I found many web-sites about create a theme.

- creating file .info
- creating style.css
- creating print.css
- creating layout.css

I would like know, what is the difference about style.css whose the principal style sheet, print and layout etc... I talken about print and layout because I saw as example.

I communicate web-sites :

* http://drupal.org/node/171209
* http://drupal.org/node/394612
* http://drupal.org/node/171205#example
The second URL, you can note

stylesheets[all][] = style.css
stylesheets[all][] = layout.css

why in the files yourthename.info, there are two style sheets ?
please anybody can explain me. I need so much.
And the same about REGIONS

regions[left] = Left sidebar
regions[right] = Right sidebar
regions[content] = Content
regions[header] = Header
regions[footer] = Footer

what do you serve " REGIONS " ?

Thanks you.

Comments

alexrayu’s picture

Man, you really should Google to do your hometask on theme internals.

But basically, different css files can be used to be applied for different media, like print and handheld.

Regions are cool. These are areas that you declare in info file and then put in your theme. Say, you assign a region in info file:

regions[abovecontents] = Above contents

And then you place it in your page.tpl.php file:

<?php echo $abovecontents ?>

And then you can assign blocks to it to, say, display menus, ads, etc.

- Alexei Rayu.

Drupal Related Services | Sitehound Drupal

r0g’s picture

How you go about creating a theme really depends on what level of control you need over the layout and contents...

Your post is entitled 'how create theme for beginning'. If you meant 'how do I, as a beginner, make my own theme' then, assuming your needs are modest, CSS may be all you need. CSS lets you customise the look of existing themes but not to modify them in any depth. If all you want is to change to fonts and colours and proportions of the areas and boxes on screen that will be fine, you are on the right track :)

If however you meant 'How do I create themes from the ground up' CSS will not be enough for you and you will need to use both HTML, CSS and quite likely some PHP. If this is the case you ought to search the drupal site for PHPTemplate and make sure you are familiar with basic HTML and PHP, in particular how Arrays work. The simple case is quite easy... copy an existing theme from the themes folder into the sites/all/themes folder and modify it's folder name, it's .info file and the .tpl.php files that define the templates for each core component of Drupal: nodes, pages etc.

Good luck,

Roger.

Jeff Burnz’s picture

Roger I know you mean well to suggest to copy one of the default themes and start messing with it but I disagree, mainly because two of them are built with tables (not a good start I would suggest), one is a pure PHP theme which is just confusing for most new users when just about every snippet on this website uses phptemplate and the other one is Garland which should not be used as starting point for learning (its not exactly a poster child for best practice and is difficult to modify).

The other thing about modding core themes is that no one actually supports them, and I for one refuse to help anyone messing with Garland.

I would suggest looking at a lot of themes but start with something thats pretty simple to grok and well supported like Basic, if that doesn't suit your need move onto something with more theming grunt like Genesis.

r0g’s picture

I'm explaining the basic principle, I didn't suggest any particular theme. Maybe there are better ones for beginners, I wouldn't know, other peoples themes have never interested me. I've always worked with what I had and it didn't take me long to find which core themes were simplest.

Anyway bluemarine is very easy to get your head round and it has all the bits you need to get started, I'd say it makes a very good starting point. If you subscribe to this anti table layout dogma and you have the prerequisite skills to be building a theme in the first place then it's pretty trivial to convert it to a div/css layout. I did that yesterday in fact, it took less than an hour. I explained to the OP that they will need basic HTML to take that route, knowing the difference between divs and tables is part of that these days. He didn't ask how do to write beautiful HTML and there's more to be gained by jumping in than spending hours browsing other themes. If you don't get it from bluemarine you're really going to struggle full stop.

Jeff Burnz’s picture

Blumarine and Push button are both removed from Drupal 7 because they are pieces of crud.

Anyone who thinks either of those old cruddy old themes is good starting point for learning Drupal theming needs an electric shock.

r0g’s picture

3 steps to getting started with theming in phpTemplate...

1) Make a template with HTML and CSS
2) Stick in snips of PHP that print your dynamic content
3) Er, that's it, you are started

Ugly they may be but for learning the basics ugly doesn't come into it. Likewise, table layouts, very 90s but that's hardly the point. If you want a first step in understanding the mechanism of theming with phpTemplate bluemarine is fine, pretty much any simple theme is fine, I have no idea why you're all getting your knickers in a twist what theme anyone starts off on.

Jeff Burnz’s picture

Because we're all working so hard for so many years towards web standards, accessibility and best practice. It justmakes sense to start off on the right foot, when there no reason not to.

Stark and the core templates is where I'd suggest anyone start to at least get to know the template system of Drupal.

r0g’s picture

No reason other than these themes don't come with Drupal 6 core. Why add an extra stage of searching and downloading when he's got files that are pretty self explanatory on his hard drive already?

I do see what you're saying but I was trying to give him a quick, unintimidating overview of the basic process, not an in depth best practice guide. It's a bit patronizing to suggest the OP won't realize there are other better themes, or that he will be somehow negatively influenced by exposure to substandard ones. He's clearly been reading around the subject, I'm sure he will figure it out.

Jeff Burnz’s picture

cstewart420’s picture

thanks for the good read .....needed a little direction and your posts helped

Jeff Burnz’s picture

Thats cool, but I just realized Alexi is the only one who really attempted to answer your question directly!

Having multiple stylesheets is just a way of splitting up really big styelsheets into more manageable chunks and/or it can be a way of logically separating out chunks of CSS, such as layout, colors, menu styles or whatever. It really comes down to how you want to work, if you prefer having one big stylesheet then go for it. Many of these starter themes split them up into "modular" styelsheets for easier management.

If you need some help getting started with css i posted an article: http://www.adaptivethemes.com/getting-started-with-css

alexrayu’s picture

That was a good read. Drupal 7 will be wonderful, I'm loving it.

As for the themes, if somebody wants to learn theming, he needs to learn xhtml/css first, and then just see how php variabes are inserted, which is easy. Then you style the output area and contents.

The topicstarter has not commented, so he either found the answers helpful or gave up.