Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Adding new variables to a specific node type

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:02
    Adding New Variables to a Specific Node Type
  • 0:06
    with Michelle Lauer
  • 0:08
    In this chapter, we're
  • 0:09
    going to talk about creating variables to use
  • 0:12
    in our node Article template.
  • 0:15
    We're going to go into template.php, create a new function,
  • 0:18
    our preprocess node.
  • 0:20
    We're going to do a check to see if we are working with an article,
  • 0:24
    and create new variables.
  • 0:26
    And then we're going to open up our nodearticle.tpl file,

Adding New Variables to a Specific Node Type


We'll go a step further with our preprocess functions and look at working with node variables, and how to limit new variables to only specific content types.

Additional resources: