3

I have created a view which displays the 10 latest news items (articles). They show up fine in teaser format. When clicking on the full article there is no title displayed and I can't work out why. This is my node--article.tpl.php:

<div class="article"> <div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>> <div class="postheader"> <?php print $user_picture; ?> <?php print render($title_prefix); ?> <?php if (!$page): ?> <h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2> <?php endif; ?> <?php print render($title_suffix); ?> <?php print render($title_suffix); ?> <?php if ($unpublished): ?> <div class="unpublished"> <?php print t('Unpublished'); ?> </div> <?php endif; ?> <?php if ($display_submitted): ?> <div class="postinfo"> <?php print $user_picture; ?> <!-- print the user picture, do not move if you want the picture displaying on the top --> <?php print t('!username • !date • !time', array('!username' => $name, '!date' => date( "d/m/y",$node->created), '!time' => date( "G:i",$node->created))); ?> </div> <?php endif; ?> </div> <div class="content"<?php print $content_attributes; ?>> <?php // We hide the comments and links now so that we can render them later. hide($content['comments']); hide($content['links']); print render($content); ?> <div class="links"> <?php print render($content['links']); ?> </div> </div> <?php print render($content['comments']); ?> </div> 

Also I should note that I'm very new to drupal and I don't know PHP very well. If anyone could tell my why that would be really helpful. Thanks.

2
  • Are you using Panels? Do you have a panel variant set for articles? Commented Mar 3, 2012 at 12:58
  • No, I'm not using panels. Commented Mar 3, 2012 at 13:15

1 Answer 1

2

Your template is expecting that the node title will be displayed as the page title, which in controlled in the page.tpl.php. Either the title is printed, but not where you expect or you don't print the page titles at all.

2
  • I don't think it's printing the titles as it's not in the source of the page. How do I get it to print the title? Commented Mar 3, 2012 at 16:23
  • Something like <h1 class="page-title"><?php print $title ?></h1> should do the trick Commented Mar 3, 2012 at 18:43

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.