Beruflich Dokumente
Kultur Dokumente
Theming 101
Why to theme
Themes allow you to change the interface of your system without affecting the business logic or code that is providing the system functionality. Think of PAC and MVC design, the theme is the view or presentation layer of a web application.
Step 5
Create a page.tpl.php file & dump your html code into the page and save it into the theme folder you created.
Step 6
Create a style.css file and place all of your CSS code into that file and save it into the theme folder you created.
Step 7
Remove all of your CSS code from the page.tpl.php file and remove all the information / text between the <head>.</head> tags.
Step 8
Place this code between the <head> </head> tags, this will print out all of your styles, java script, page titles, etc
Step 9
At this point, you will need to place the following code, where your main content display area is in your design. This will print out page content and local menus that appear as tabs. <div id=content>
</div>
Step 10
In your theme, you should have an area for primary and secondary links defined. Replace the HTML code that you are using for these with this:
Step 11a
You will need to define Regions that will display Blocks of content. By default you have the following regions: regions[left] = Left sidebar regions[right] = Right sidebar regions[content] = Content regions[header] = Header regions[footer] = Footer
11c Print the content of the region in you page.tpl.php file, locate it where you want the content to be placed.
Congratulations!
You just made a theme!
template.php
Functions included in this file can be called in your theme. To override a function in Drupal such as the theme() function, you can copy the code for the theme function from http://api.drupal.org and then paste it into your template.php file. You will need to append the name of your theme to the function and then modify its code to suit your purposes.
node.tpl.php
Default node theme
node-story.tpl.php
Custom template theme for a specific content type.
block.tpl.php
You can create custom themes for each block
page-front.tpl.php
Custom Front Page
Overrides