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"?
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | title gap.jpg | 44.92 KB | Phil-Hatching |
| #2 | sirate-basic-page-title.PNG | 3.61 KB | mrpeanut |
| #2 | sirate-webform-title.PNG | 5.54 KB | mrpeanut |
Comments
Comment #1
chats commentedComment out the following line in the page.tpl.php file :
Comment #2
mrpeanut commentedThat 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).
Comment #3
leostar commentedI 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
Comment #4
chats commentedYou 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.
This works, but not perfectly. The header is only over the article, and not over the sidebars.
Comment #5
chats commentedOkay...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.
Add this function to the function tb_sirate_preprocess_page in the preprocess_functions.inc file in your inc directory.:
See : http://drupal.org/node/917548#comment-3475034
Comment #6
leostar commentedThanks a lot, I will try this and let you know the outcome.
Leo
Comment #7
naleenyadav commentedThanks Chetan its working fine
Naleen
Comment #8
technikh commentedthis looks like a bug to me. not showing the node title and instead showing the node type
Comment #9
Phil-Hatching commentedThe 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?
Comment #10
rooby commentedWhat 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.
Comment #11
rooby commentedComment #12
animaluksmall commentedChange 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.
Comment #13
rooby commented@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:
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.
Comment #14
themebrain commentedComment #15
rooby commentedWhat 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.
Comment #16
themebrain commented@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.