First off, love the theme (and all the other TB themes—Drupal needed some high quality themes).

I'd like to remove the content type name from the header on certain content types.

For example, when I create a webform, the title (in the blue bar) is "Webform." The title of the node (in this case, "Contact Us") is further down.

Is there a way to remove that "Webform" and make it "Contact Us"?

Comments

chats’s picture

Comment out the following line in the page.tpl.php file :

   <h1 id="page-title"><span><?php print $title; ?></span></h1>
mrpeanut’s picture

StatusFileSize
new5.54 KB
new3.61 KB

That removes the title from every node. On some content types, the title is actually the node type. See my two screenshots. One is for a Basic page (which shows the node title) and one is for a Webform (which shows the node type, Webform, as the title, and then the node title is further down).

leostar’s picture

I am also facing same issue, have you got any solution yet. When I created a basic page it shows header in blue bar, if I comment the
print $title;

line then everything is gone, no blue bar, no header for basic pages. Don't know what to do. Anybody can help please.

Leo

chats’s picture

You need to create a custom template for your content type.

See: http://drupal.org/node/1089656

I haven't been able to call the page template for a custom content type, so instead I copied and renamed the node.tpl.php file to
node--my_content_type.php (replacing my_content_type with blog/article etc)
and copied the following lines to the beginning of the document.

<div id="main-wrapper" class="wrapper"> 
      <div class="container-inner clearfix">
        <?php if ($title): ?>
       <h1 id="page-title"><span><?php print $title; ?></span></h1>
        <?php endif; ?>
		</div>
	
</div>

This works, but not perfectly. The header is only over the article, and not over the sidebars.

chats’s picture

Okay...figured out how to do it properly.

Rename and copy the original page.tpl.php file to page--my_content_type.tpl.php. Make sure you still have the original file in your directory.
Comment out or leave these lines in the content type you want to show or hide the header.

<?php if ($title): ?>
       <h1 id="page-title"><span><?php print $title; ?></span></h1>
        <?php endif; ?>

Add this function to the function tb_sirate_preprocess_page in the preprocess_functions.inc file in your inc directory.:

if (isset ($vars['node'])) {
		$vars['theme_hook_suggestions'] = array();
		$vars['theme_hook_suggestions'][] = 'page__'.$vars['node']->type;
	}

See : http://drupal.org/node/917548#comment-3475034

leostar’s picture

Thanks a lot, I will try this and let you know the outcome.

Leo

naleenyadav’s picture

Thanks Chetan its working fine

Naleen

technikh’s picture

Category: support » bug

this looks like a bug to me. not showing the node title and instead showing the node type

Phil-Hatching’s picture

StatusFileSize
new44.92 KB

The fix by chats worked but it brought up another issue. On Chrome the page looks fine but in IE and other browsers there is now a gap between the white space at the top of the page. I've attached a screenshot of the affliction. Does anyone have any ideas on how to address it?

rooby’s picture

What I did was to make it so that instead of the node type in the title area and the node title below, in the content area, I have the title always in the title area.

To do so all I did was delete the tb_sirate_preprocess_page() and tb_sirate_preprocess_node() functions from the preprocess_functions.inc file in the inc directory.

Currently all those functions are doing is this node type title change, so all removing them does is reverts back to normal title handling, which I think is better.

rooby’s picture

Version: 7.x-1.0-beta1 » 7.x-1.0
animaluksmall’s picture

Change this line (line number 26) within the 'preprocess_functions.inc'...

->condition('type', $vars['node']->type)

to this...

->condition('type', $vars['node']->title)

Now all your content types will display the correct titles.

rooby’s picture

@animaluksmall:

That solution is not ideal because then that code you changed in preprocess_functions.inc is actually redundant code that is not doing anything (by default in drupal it will use the page title.

A better solution is the one in comment #10:

delete the tb_sirate_preprocess_page() and tb_sirate_preprocess_node() functions from the preprocess_functions.inc file in the inc directory.

It will have the same affect as what you have done, while having the added benefit of less custom code, which would mean an extremely slight performance benefit.

themebrain’s picture

Status: Active » Fixed
rooby’s picture

What do you mean by fixed?

The theme has been changed, or a workaround has been mentioned that we can implement if we need it?

Becasue this is a bug report, not a support request, so it should either result in a change to the theme code or be changed to a support request and mentioned that it won't be fixed in the drupal.org version of the theme.

themebrain’s picture

Status: Fixed » Closed (works as designed)

@rooby
Oops! That's my fault. I should changed the status to closed (work as designed). This issue is not a bug because the theme is designed to display content type in header. Moreover, the solution you suggested in the comment #10 is recommended for people who want to display page title in header.