can anyone tell me the difference between template and theme

Comments

greylogic’s picture

Theme refers to a set of files which control the HTML generation/presentation. For each request the drupal and modules create the data as a data structure (associative array or object). The theme layer takes this data and creates HTML. It also has css files to control styling.

Template in the context of a theme are files with the html code, with placeholders for actual data. in the case of php templates the placeholders are php variables. Template files contain the html generated for a particular piece of content like node, block etc.

aflatoon’s picture

can you explain that in more simple words.

thanks

Jeff Burnz’s picture

Theme = lots of files in a folder - for example; page.tpl.php, node.tpl.php, block.tpl.php, style.css, template.php
Template = one file, for example; page.tpl.php

A theme is therefore many files that work together and a template is just one of the files (there can be many templates in a theme).

aflatoon’s picture

thanks :)

severus lily’s picture

@Jeff burnz sir I have some doubts in themes. I created a form to add images to cloudinary using **theme_image_multifield_multitype()**. But this is not getting called. In the error report it is showing "Theme hook image_multifield_multitype not found". why this is not getting called?

VM’s picture

your question has nothing to do with the opening post. Your question deserves its own thread.

severus lily’s picture

okay.

jesusfish’s picture

Hi everyone. Just getting familiar with Drupal and loving it so far. In my research of Drupal themes I came across this post and it has me wondering (and please excuse me if this is noob but) which is better to use, Template or Theme? TIA

Jeff Burnz’s picture

Drupal uses themes, a template is just one file in the whole theme package. At minimum a Drupal 6 theme consists of an info file and a CSS stylesheet (Drupal has default templates it falls back on if none are included in the theme).

I've run into the occasional issue of a theme not being recognised by Drupal if a page.tpl.php file is omitted, so I tend to always use one - in any case this is the grand-daddy template file and the one that often gets the most customisation.

So, to answer your question - both.

Need help with IE?
Learn basic XHTML and CSS first.
Get smart with web specs.

jesusfish’s picture

I had a feeling you were going to reply that way. Thank you.

jesusfish’s picture

While searching for some cool website ideas to add to my church's website that I'm developing I found this link: http://www.mygenerationschurch.com/. My pastor and I fell in love with this site theme. I did some checking (looked at the source code) and realized it's a Joomla theme. Since we think this theme is perfect for our church I'm wondering what can be done to get this theme into Drupal? Any constructive ideas and suggestions are greatly appreciated. TIA

Jeff Burnz’s picture

No, because the theme is not GPL, but rather a commercial design by the website developer.

Of course the design can be achieved in Drupal, that is no problem at all.

jesusfish’s picture

Ok, i'm feeling better about the under-taking of creating a "similar" theme but how easy is easy? Since I am a Drupal newbie I'm not that good with theme creation. Any recommendations on how and where to start?

For the record, the template main content area is where I'd like to have big pictures in a table-light linking to other pages within the site module and a calendar, very similar to the church website I mentioned before. TIA

VM’s picture

start with the theme developers guide in the documentation area.

use the firefox browser with the firebug addon to begin familiarizing yourself with what themes are doing and how it all comes together. Then feel free to start tweaking or building your own from scratch.

jesusfish’s picture

I will do that... ThANK YOU

Jeff Burnz’s picture

For building your own highly customised theme you might want to start with a base or "starter" theme, http://drupal.org/node/323993 is a round up.

golinagaraju’s picture

Theme is collection of temples.
templets are like page.tpl.php,node.tpl.php,comment.tpl.php etc...

Jeff Burnz’s picture

This question is over 7 years old, I think it's safe to say we're done here...

wpthemesindia’s picture

All templates are categorized under a theme. The theme is where the HTML/CSS code for a template is located. Just like WordPress themes and WordPress templates. For many people, the use of the word Theme and Template mean the same thing

rockthedrop’s picture

Please correct me - because I certainly need the guidance / help.

I've been reading LOTS of D8 documentation and reviewing API code and naming convention. I'm remembering seeing some functions (which I assume can be overridden) prefixed with template_ and some functions (which I also assume can be overridden) prefixed with theme_.

I'd love to know the difference if you can tell me.. 'cause I been trying for days.  coming up blank.