Customizing node templates and variables


show more Customizing node templates and variables provides you with in-depth training on Web. Taught by Chaz Chumley as part of the Drupal 7: Creating and Editing Custom Themes show less
please wait ...

Customizing node templates and variables

Most content in Drupal that is not generated by a block or a view is considered to be a node and each node can be identified by its ID or type whether it's a page, article, or custom content type. These attributes give us great control over theming the HTML output by each node and its template. Based off our static mockup we are not doing anything special with the individual nodes or node types, other than simply cleaning up the HTML.

So let's begin by browsing to your editor and expanding the modules>node folder. And if we look in here we can see the node.tpl.php template. I am going to right-click and copy this and then I am going to paste this into my sites>all>themes>samoca>templates folder. Now that I have this in my folder I can go ahead and double-click on it to open it and take a look at what this template contains.

If we scroll down a little bit we can see Available variables such as $title and $content as well as other variables such as, $node, $type, $co...

Customizing node templates and variables
Video duration: 4m 49s 3h 36m Intermediate

Viewers:

Customizing node templates and variables provides you with in-depth training on Web. Taught by Chaz Chumley as part of the Drupal 7: Creating and Editing Custom Themes

Subject:
Web
Software:
Drupal
Author:
please wait ...