Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Drupal 7: Theming Fields and Nodes with Templates

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
44,425
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Mar 24, 2010

Override Drupal's default HTML output using templates. You can override individual fields and content types.

Video #8 in this Intro to Drupal 7 series.

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (linwclark)

  • I am concerned about this videos recommended practice of simply copying core *.tpl.php files into our theme folder now with the intention that they over-ride the core *.tpl.php files because if future updates to Drupal make changes to the core *.tpl.php files, those new changes will not be applied because my old theme *.tpl.php files will continue to over-ride the new changes. Is my concern unwarranted or valid?

  • @chrisaquakeys this is the official recommended practice for Drupal theming. See drupal.org/node/173880 for more info. If you are overriding a theme, then you are probably trying to create your own HTML template which would differ from the default template file. What kinds of changes would you want to see propagated from the default file to your new file that is overriding the default?

  • @linwclark @chrisaquakeys Hey Lin, thank you first off for doing these great videos. Although I love your videos, I have to agree with, chrisaquakeys, right above,

    What happens for instance, when a client wants to upgrade to D7?

    Do you then have to go in each individual .tpl.php file and hope that you remember all the changes and tweaking that was done to the earlier version? How does your way of theming .tpl.php core files go with upgrading to a higher version of Drupal? Thx btw

  • @joelfoit You don't have to customize templates in Drupal if you don't want to. However, if you are customizing a particular template, this is the way to do it. This is explained in the Drupal handbook at drupal.org/node/173880

    No matter what, if you are upgrading from one major version of Drupal to another major version of Drupal and you have a customized theme, you are going to have to port it to the new version, just as you would a custom module.

see all

All Comments (37)

Sign In or Sign Up now to post a comment!
  • Hi, I have seen the video several times and seemed very professional, thank you very much for sharing.

    I have two questions:

    I created a form content type with certain fields and my goal is to modify the page the user sees when entering this type of content. I have to create a. Tpl.php for each field that has my form content type? Would you kindly tell me I have to do?

    Thank you very much.

  • Hi, i just wanted to thank you for your clear and helpfull tutorials! You are really doing a good job here! Thanks from belgium!

  • how do you get the "article"?

    where can I find it?

    please teach me~

  • wow you are very clear and talented. Keep it on. We would like to see more videos from you!!

  • Great job, very clear and helpful

  • at approx 6:30 into the video, i get an error when i place the print_r(array_keys($content)) code into my "node--staff.tpl.php" file while trying to see the custom field variables i have available to me. i get a warning saying the 1st argument should be an array ? any ideas?

  • Thanks, Lin. Brilliantly done -- great information, very clearly presented.

  • This is exactly what I was looking for and more. Thank you very much and keep up the great work. These videos have helped me considerably. I love that Drupal recognises that if you specifically print a variable, that it's surpressed from the main output loop. Also, it's great that you've shown us how to specifically output that variable again. Great stuff.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more