on a node page is it posible to change the order of the article elements like this ?

<article>
<h1>My article</h1>
<p>Blah blah</p>
</article>

instead of

<h1>My article</h1>
<article>
<p>Blah blah</p>
</article>

Comments

lelizondo’s picture

just override the node.tpl.php file.

heyyo’s picture

<?php if ($page && $title): ?>
  <header>
    <?php print render($title_prefix); ?>
    <h1 <?php print $title_attributes; ?>><?php print $title ?></h1>
    <?php print render($title_suffix); ?>
  </header>
  <?php endif; ?>

But now how to not display the title on page ?

Because now it is displayed twice. Which file do I need to remove the first display of the title ?

lelizondo’s picture

the page title is handled in page.tpl.php and not in node because not every page is a node.

if you want to hide the title on a some nodes of some content types you could use http://drupal.org/project/nodeformsettings

himerus’s picture

A related post is here in the HTML5 group: http://groups.drupal.org/node/138729

It's a tough situation, and a LOT of times in my own themes, I will NOT render the page title in page.tpl.php if the page IS in fact a node... but instead pass that along to node.tpl.php to render... still as a H1 inside node.tpl.php if it IS a page view...

This may get implemented in the 3.x version, but I'd like to follow some further discussions on this to determine any gotchas or forgotten use cases for WHY the title is rendered how it is. I wouldn't be surprised to see this change in D8.

lelizondo’s picture

If I remember correctly, in D7 you have access to the $node variable in page.tpl.php so you can do an if and determine if it's a node or not.

paskainos’s picture

#4:

This may get implemented in the 3.x version...

Jake, has this been addressed in 3.x?

Cellar Door’s picture

Assigned: Unassigned » himerus
Status: Active » Postponed (maintainer needs more info)
steinmb’s picture

Version: 7.x-2.x-dev » 7.x-4.x-dev
Assigned: himerus » Unassigned
Category: Bug report » Feature request
Issue summary: View changes

Housekeeping. Should we go ahead and close or set it back to active?