"Log Out" appears in the title and as the heading of the front page

ssg13565 - July 2, 2009 - 20:58
Project:Front Page
Version:6.x-1.2
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I don't know if I had this problem from the beginning of installing front_page or I just didn't notice it for a while.

At the top of the page their was the header "Log Out". This also showed up at the beginning of the page title in the browser bar at the top.

I solved the problem by putting the following PHP code at the top my my front page:

// Set the title to the empty string to avoid an extraneous
// title or heading on the front page.
drupal_set_title("");

The problem comes from the function template_preprocess_page.
In the function template_preprocess_page, search for the string "Construct page title".

    // Construct page title
    if (drupal_get_title()) {
        $head_title = array(strip_tags(drupal_get_title()), variable_get('site_name', 'Drupal'));
    }
    else {
        $head_title = array(variable_get('site_name', 'Drupal'));
        if (variable_get('site_slogan', '')) {
            $head_title[] = variable_get('site_slogan', '');
        }
    }

If the title is not empty, then it picks up the wrong title, Apparently the title "Log out" was left over from somewhere. I realized that I didn't care who left it. I just needed to make sure it went away for the front_page.

The front_page module ought to take care of this itself. As a relatively new Drupal user, it took me nearly a week to figure this out.

 
 

Drupal is a registered trademark of Dries Buytaert.