Drupal theming for designers, continued.

Drupal Theming – Part 2 – Controlling themes

This is a continuation of the earlier article on Drupal theming for designers.

Near the end of the previous article, we mentioned other *.tpl.php files used by themes. These files, and any others that you create, using Drupal’s PHPTemplate file naming convention, you are able to ‘override’ the default display:

  • node.tpl.php
  • block.tpl.php
  • box.tpl.php
  • comment.tpl.php

Drupal’s PHPTemplate theme engine uses the content generated by these files in page.tpl.php, as the following diagram demonstrates:

More control means more power

Using the *.tpl.php you can control:

  • the display of different content types, such as blogs, forum posts, or anything else you create. What are 'content types' (node-[content type].tpl.php)
  • the display of content in edit-mode (node-edit.tpl.php)
  • the display of individual nodesWhat is a 'node' (node-[node ID number].tpl.php)
  • the display of the front page

Controlling the content being passed to the *.tpl.php using variables

Let’s look at the variables used in page.tpl.php and node.tpl.php:


Here, we see page.tpl.php prints variables such as $sidebar_left and $mission.


In node.tpl.php we see variables such as $sticky.

You can use template.php to override functions returning these variables and you can intercept other variables:

This template.php example, from the Zen theme, demonstrates function overrides:

  • zen_regions
  • zen_breadcrumb

Here is the documentation listing all themable functions: http://api.drupal.org/api/group/themeable/5

A brief note regarding regions

It also demonstrates variable re-definition, which is scope controlled:

  • $vars[variablename]

Here is documentation listing all variables available in page.tpl.php, node.tpl.php, and block.tpl.php.

For more on creating Drupal themes, I recommend the following:

Comments

While the FDA has not advised or approved the HCG for weight regimen, it is legal to ship it to any country for personal use
and a lot of people actually inject HCG on their own at home.
I can wrap my head around the science of it, but I am still unsure, despite all the
digging up of stellar feedback, that the oral drops are as effective, or make
any difference at all; perhaps it's all in our
minds. I know, I'm not one to waste either, but look at it this way, you're keeping everything that is necessary and eliminating what is not.

hcg weight loss atlanta reviews (not verified) | Sat, 10/18/2014 - 23:33 |

Anyone who is interested in this plan can find numerous recipes and resources on the Internet.
Was it mixed with alcohol and sprayed it would be devastating, one can imagine
to have. These alternatives will still give out the same one to two pounds of weight loss per day.

hcg weight loss vancouver bc (not verified) | Sat, 10/18/2014 - 20:31 |

A Final Ɗistant Clarion Cry - I fell under the influence of varіous Fundamentalіst Christian сritics of Rock muѕic for a
brief period in 2003, which mɑde me feel inclined to dеstroy all tгaces of Rock music in myy possession, even though
I'd long lost aany real tɑste ffor Hard Rock by then,
whether in thе shape of Metal, Pսnk, Goth, Grungе oor ԝhatever.
Rather than all regfսlar drumkіt percussion, thе Mіddle Eɑstern darbuka gdts
ann outing. Shee drums for Lisaa Beck's West African dаnhe clаss.

cajones de minitecas (not verified) | Sat, 10/18/2014 - 06:52 |

Today, air pollution is a burning issue all over the world.

These companies are registered and licensed so that the customers can simply believe on their services.
They can in addition be changed as per our requirements, we can print
our logo or notify on them. It is the fifth most populous
city in the world and the most populous in India.
Universal Studios Hollywood should be your next destination. Before you
get started make sure that you have a measuring tape,
regular hammer, some nails, a level some caulking, some wood shims and some insulation on hand.
People may go for any of these services of relocation according to
their need such as Home, local household,
city wise household, business, commercial, industrial, corporate, etc.
An office must contain wide range of large and heavy furniture.
Parks such as Bear Creek and Washington Parks
have green spaces for sports teams, and the adjacent Rocky Mountains offer hiking,
biking, and other outdoor opportunities. To do that, you have to
visit your local County Tax Office, and provide them with the
required documentation.

moving companies peachtree city ga (not verified) | Thu, 10/16/2014 - 11:10 |

It is not a senior editor or a human resource manager but people
that decide what to read and what to watch. You always want to track data relevant
to your traffic and conversion rates. On-site Optimisation is also a very important
part of SEO process as this process optimise your
website up to 30 to 50%.

social media marketing business plan (not verified) | Wed, 10/15/2014 - 09:33 |

I for all time emailed this web sitee post page to all my contacts, because if like to
read itt next my contacts wiull too.

business coach (not verified) | Tue, 10/14/2014 - 13:41 |

Indeed with an expanded automotive industry has lead to a
high demand for steel and rubber. Zipper application field: Raincoats,
tents, bags, shoes and boots, ski clothing, water-washed
jeans or leather products with high acidity and other special requirements.
If you are unable to unclog a drain after trying a number of methods, it is important to call a plumber.

* Some of the storehouses can also help you host your belongings during your sale period.
One can hire services of professional movers as complete relocation services
or customize ot as their budgets. Wonderland miami is not only for fast movers, they have also cabaret
dancer for young hearts, that provide a full of entertainment who prefer this nightly entertainment and style of music because
this is a great location to check out the latest DJs and
hit tracks as well as there is ample room for socializing and mingling with other customer and dance-floor can get quite congested.
To overcome these hectic job professional cleaners must be hired
as they would guide the work of moving in a very efficient and
smooth way. But don't forget to investigate them as fraud
cases are always on the list. It is dyed indigo while
the waist-band is white in color. Usually linear strobe lights are soldered firmly which provides vibration resistance, so that the lights can operate even when the car is treading on very uneven terrains.

moving company ratings vancouver (not verified) | Fri, 10/10/2014 - 03:56 |

The process of implementing a social media campaign can be daunting.
Again, the best way to increase page rank is
to stay consistant. After so much spent or so many visits, offer a free product or percent off.

hamilton beach marketing (not verified) | Tue, 10/07/2014 - 21:23 |

Some price leaders are offering sliding wardrobe doors that
are custom made to your measurements at the most reasonable price.
If you have problems with flooding of your basement or garage, you may need a specific type
of drain called a sand trap drain. Depending on the dimension and type
of the articles to be stored, you can select large or mini storage units.
This could prevent your car from any kind of damage at the time of hail or wind.
The odd thing about these scrapers are they are coming as an additional feature in the food processors that means you cannot buy
the coconut scrapers alone instead you will have to buy the processor
with other features also. You can now rely on them as the best packers and movers in India hold direct permission given by the government to carry out their work.
Taking boring pictures is a common frustration every beginner encounters.
Homeowners will no longer need to worry that potential criminals have access
to their home. Replacing a pane of glass successfully requires overall taking simple precautions, and paying attention to detail and details.
, delivery of pizza requires preparation of base,
application of sauce, topping of vegetables,
baking of pizza, packaging and then delivery.

local movers west palm beach (not verified) | Tue, 10/07/2014 - 09:58 |

Regardless of your industry and business size, Facebook and Google+ are two of the Big Four social platforms that you can’t afford to ignore.

So, you've gone through and built a starting network.
Controlling your time and energy and the zero's on your paycheck is essential these days, and with this
type of business you are able to.

marketing Agency boca Raton fl (not verified) | Mon, 10/06/2014 - 03:09 |

Most Internet marketers are looking for a "get rich quick" solution for their problems, and they
come into this industry without learning the basics.
Promote multiple affiliate programs in your website but
don't promote every little thing the world has to offer.
But other than those who just want to communicate with friends, old and new, social media is
also currently being taken advantage by business oriented people
as a way to reach their target clients and improve their businesses.

internet marketing company west palm beach (not verified) | Sat, 10/04/2014 - 20:31 |

As great as part 1. This is the most useful tutorial for the beginners to design their own themes.

Guest (not verified) | Thu, 07/10/2008 - 12:40 |

Can these themes be implemented on something else and not a Drupal template?

Guest (not verified) | Wed, 07/02/2008 - 06:10 |

The correct link for the apress pdf file to download is: http://apress.com/resource/bookfile/3486

that should correct any link problems.

Guest | Wed, 06/18/2008 - 01:41 |

I had no idea that Drupal themes are created using PHP now. How do they fit with older ones that are not using this programming language? I tried combining pHp with my old code on offshore corporation but nothing really changed.

Guest (not verified) | Fri, 06/06/2008 - 07:56 |

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.

More information about formatting options