I created a custom template, node--article.tpl.php which renders my field_image field first, then shows the submission date, then displays the title and then renders the rest of the content.

This works very well in Teaser, but when I click on the node and view it in Full, the Title is rendered at the top. It is above the field_image instead of where it exists in the template. My template is just a slightly altered version of the Zen node.tpl.php. Why is the title being rendered up top instead of where it is in the template?

Here is my template:

<article class="node-<?php print $node->nid; ?> <?php print $classes; ?> clearfix"<?php print $attributes; ?>>

  <?php print render($content['field_image']); ?>

  <?php if ($display_submitted): ?>
    <p class="submitted">
      <!--<?php print $submitted; ?>-->
      <?php print $pubdate; ?>
  <?php endif; ?>

  <?php if ($title_prefix || $title_suffix || $display_submitted || $unpublished || !$page && $title): ?>
      <?php print render($title_prefix); ?>
      <?php if (!$page && $title): ?>
        <h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
      <?php endif; ?>
      <?php print render($title_suffix); ?>

      <?php if ($unpublished): ?>
        <p class="unpublished"><?php print t('Unpublished'); ?></p>
      <?php endif; ?>
  <?php endif; ?>

    // We hide the comments and links now so that we can render them later.
    print render($content);

  <?php print render($content['links']); ?>

  <?php print render($content['comments']); ?>

</article><!-- /.node -->

Just a thought, have you tried using Display Suite?

| improve this answer | |
  • I haven't, but that looks pretty cool. Going to go check it out right now! – Kenny Wyland Nov 11 '12 at 22:42
  • So, I've got installed, removed my custom template, and I configured my node type so that it should display in the right order... but it's still showing an additional Title at the top of the page. How can I disable that Title? – Kenny Wyland Nov 11 '12 at 22:50
  • In manage display /admin/structure/types/manage/content_type/display y probably you need the full content and disable the title. If you want to see more about what you can do with display suite I recommend this link london2011.drupal.org/conference/sessions/… – cayerdis Nov 12 '12 at 4:03
  • Have you anything else which could be outputting that extra title? i.e. other modules, it's being displayed in a panel, etc. etc. – stevepurkiss Nov 12 '12 at 13:18
  • This module doesn't really answer my question, but it's so awesome that I'm accepting this as my answer. – Kenny Wyland Nov 13 '12 at 5:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.