Hi all,

I'm quite new to drupal, I've been reading webpages all week to feel more comfortable with the way the administration works. Now I started creating my own theme. I have some really basic PHP knowledge. I have made my design in valid XHTML and CSS, no tables. I hae set up a test site on my own pc.

I copied the bluemarine theme dir and started with removing everything from the page.tpl.php file. Than I pastd my html in and copied lines of php code I felt necessary. This way I managed to get it about the way I wanted it to look. I copied my css into the style.css file.

I'm stuck now however: by looking at the source (mainly the class and id selectors) I think the node.tpl.php is used for showig the frontpage content, but I have no idea how drupal knows where to place it.

I have this part of code in my html on page.tpl.php:

<div id="center">

	<?php print $breadcrumb ?>
		<h1><?php print $title ?></h1>
		<?php print $tabs ?></div>
		<?php print $help ?>
		<?php print $messages ?>
		<?php print $content; ?>
		<?php print $feed_icons; ?>
	
</div>

I have no idea what everything means, but somehow the node.tpl.php file seems to be placed right after this div, while I would like to place it inside this div. Could somebody point me at a good manual for theming my own site, all the ones I found so far didn't go quite deep enough for me.

Thanks in advance!

Comments

jeremycaldwell’s picture

I struggled too with developing my own themes so hopefully my post will give you some more insight.

http://nerdliness.com/article/2007/09/10/drupal-theming

-Jeremy
www.eternalistic.net

--
Jeremy Caldwell
www.eternalistic.net

sign’s picture

The $content variable outputs the content.

Look at this line in your code:

<?php print $tabs ?></div>

You can see that you are closing the div tag here, then outputing $content. So you should delete this div end tag.

__________________________________ ____ ___ __ _ .. .. .
Give a man a fish, and you'll feed him for a day. Teach a man to fish, and he'll buy a funny hat. Talk to a hungry man about fish, and you're a consultant.
- Scott Adams

http://sotak.co.uk

libeco’s picture

Ooooooh what a stupid mistake! I'm ashamed! Thank you guys for all those links, I only read the ones here in the drupal.org handbooks. I'll continue and see if I can get everything to work te way I want. Thanks again!

ms1’s picture

Hi

I do not know if you have already read the theme developer's guide ( http://drupal.org/theme-guide ) . If not, please go through it, it is quite comprehensive and will answer most of your questions.

Specifically for understanding what the variables being printed, they are also available in the theme developer's guide at:
Node.tpl.php - http://drupal.org/node/11816
Page.tpl.php - http://drupal.org/node/11812
Block.tpl.php - http://drupal.org/node/11813
Box.tpl.php - http://drupal.org/node/11814
Comment.tpl.php - http://drupal.org/node/11815

--------------------------

Since you are creating your own theme something by Sepeck can be helpful to you. See his tutorial
http://www.blkmtn.org/Quick-and-dirty-OSWD-theme-to-Drupal

Also I believe you can spend some time watching this video, it would be good to get your basics right.
http://drupaldojo.com/lesson/theming-like-a-pro

Regards