First off, I am a bit of a newb...now I have tried several different methods including changing some of the code as well as trying a few different modules with no success.

I would like to hide the node title (with it still existing within the code for SEO) so that it does not display on pages or particulars pages anyways.

This is just me, but I would have thought this functionality is rather sinply and would have been built into Drupal 7 simply by a toggle box, or maybe it is and I am overlooking it.

Comments

nagarajanl’s picture

Hi,
Add this function in your template.php of your theme folder (if the function already exists just replace the few lines)..

function bartik_preprocess_node(&$variables) {
$variables['title'] = NULL; // Hide the node title before the node is getting rendered.
}

for more reference http://api.drupal.org/api/drupal/modules--node--node.module/function/tem...

jensimmons’s picture

Status: Active » Closed (fixed)

Thanks for your interest in Bartik!

You will get a better response for your question by using IRC to chat with people in the Drupal community live, or by posting a question in the forums. In fact, maybe someone has already answered your question there, or maybe in the documentation.

gfurnivall’s picture

Is there any way to get rid of the title of the node on one type of content (ie basic page) on Drupal 7? I'm no good at PHP but can follow instructions if someone tells me what code I need and where I need to insert it!

fakingfantastic’s picture

Pascal.s’s picture

Easy!
Just install the automatic node title, create a new content type (i suggest not using the basic page in case you would like to have a title on some pages). Then edit your new node type, go to "Automatic title generation" and select "Automatically generate the title and hide the title field" and that's it!
The inconvenient: if you want to edit your page, you have to go to content or type the clean url in the address bar.

snoopy77’s picture

Yes, and make same change in function

 bartik_process_page(&$variables)

in order to perform the same op on main content. Thanks !

tanitani’s picture

Simply use http://drupal.org/project/exclude_node_title. It takes care of it with as granularity as you want.

ajitartist’s picture

Thanks that was a great help using "exclude node title" i was spending ages to remove the title from a view

manorius’s picture

It should be page instead of node.
Node is not working for me, but page does.

function bartik_preprocess_page(&$variables) {
$variables['title'] = NULL; // Hide the node title before the node is getting rendered.
}
gramie’s picture

Rather than set $variables['title'] = NULL, you can set $variables['title_hidden'] = TRUE. It certainly worked for me.

Some themes, like Omega, also have a setting where you can just click a checkbox to hide titles.

r_sharma08’s picture

Hello Drupal Developers,
Is there any way to remove page title of a single page in drupal7.
I want to change page title "Search" in search Results.

Thanking you in advance

Rajnish

DeepRed_99’s picture

#7 worked for me!
tried #5 first, but got A LOT of problems, that eventualy couldn`t resolve.
thank you

fonea’s picture

Hi,
You can hide title like this:
- in
HOOK_form_alter(&$form, &$form_state, $form_id) {

~~~~~~
$form['title']['#type'] = 'hidden';
~~~~~~

}
and now it is a hidden field.

thanks

batigolix’s picture

Dave Hirschman’s picture

I just wanted a cheap and simple solution to prevent the title and breadcrumb from being displayed on one or two nodes, so I added an implementation of hook_node_view_alter to my custom module,

function mymodule_node_view_alter(&$build) {
  if (drupal_set_title() == 'NO TITLE') {
    drupal_set_title('');
    drupal_set_breadcrumb(array());
  }
}

cleared cache, and set the node titles to 'NO TITLE'.

sumaiyajaved’s picture

There is a module for this https://drupal.org/project/vscc

ferenju’s picture

To disable the basic page title, you have to write a simple CSS style on the body part of your BASIC PAGE and make sure you change the area to FULL HTML mode.
Here is the code that disable the title of a page, only for the page that you placed this code.

<style>
#page-title{display:none}
</style>

You may have a different page title ID, so make sure you change #page-title to your page title id.

This is very help full when you use a BASIC PAGE as your FRONT page.

Hope this help some one.

AD

beastb9’s picture

.node-title {dispaly :none;} in your style.css