Customizing the node template

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:08
    In this chapter, we're going to take a look at overriding Drupal's node template file.
  • 0:13
    In the previous chapter, we looked at creating a new page template file.
  • 0:16
    We did so by copying our index.html file into our theme
  • 0:20
    and renaming it to page.tpl.php and then starting to edit the file,
  • 0:25
    replacing the static markup in the file with dynamic PHP variables.
  • 0:30
    In this example, we'll show you
  • 0:32
    how you can copy one of Drupal's existing template files into your theme
  • 0:35
    and then start to make changes to that file to modify the HTML.
  • 0:39
    What I'd like to do is start to modify
  • 0:42
    what the actual pieces of content printed out on our site look like.

Customizing the Node Template

Loading...

Walks through the process of copying the default node.tpl.php file from the core node module into the theme, and then customizing the output specific to individual in order to match the design. See how to add specific variables, when to use conditional if statements and the best way to debug and iterate through this process.

Additional resources: