Page Title vs Node Title

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
jshock's picture

I am somewhat confused by the difference between Page Titles and Node titles. I have a Node Template set up in Panels for specific content types. I've deleted $title from my page.tpl.php and am using a node template to place it in the content. The problem I am having is that when I use the "Node being viewed" title I get the correct title for all the pages EXCEPT the Home page (which is set for node/1). The home page title comes up as "Home" even though that isn't the page title.

If I use just the page title, I get the correct title, but am unable to assign the H1 tag (like I can with Node Title). Why is the Home page node title different? Is there some way I can assign H1 to the page title in Panels, or do I have to write a custom class? How come Node titles use html tags like h1, but Page titles only allow for custom classes?

Comments

Theming question

Itangalo's picture

What markup is used for titles is determined by the sites theme, so this is actually a theme question rather than a Panels question.

I'm pretty sure it is possible to use a special theming template front.tpl.php to style the front page differently. If this is used in your theme, then it would override any node.tpl.php templates – which would explain why your front page is themed differently.

If you want to use h1 titles in Panels, then I think the best approach is to create a new layout plugin – I think this is the plugin that determnines the page title markup. (If you're clever you could probably add settings to it, for allowing site admins to select which level of title should be used. I'm not sure this is a good idea, though.) I don't know how to create new layout plugins, possibly the best approach to this is to look at the plugins available in Panels and go from there.

In general, I think the title of page content is (for most themes) set to h2 with regard to the site title – which has the h1.

Cheers!
//Johan Falk
**
Check out NodeOne's Drupal Learning Library! 150+ screencasts and exercises, for Drupal introduction, advanced configuration, and coding.

Panels

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: