On some pages the page title module gives an wrong title output.

"View" | [sitename]

is the output.

the sitename is correctly given, but before there stands "Views". It occurs on some pages. i dont know when the error exactly happen.

CommentFileSizeAuthor
#9 drupal-conf.gif61.77 KBWitch
#9 page-title.gif44.18 KBWitch

Comments

nicholasthompson’s picture

Status: Active » Postponed (maintainer needs more info)

Erm... Thats very odd! Are you definately using Alpha5 and not Delta?

Does this happen on, for example, the admin/build/view page?

Witch’s picture

Status: Postponed (maintainer needs more info) » Active

I am sure that i am using the latest version Alpha5.

It occurs on a story node. On one story node the title is correctly on another one it shows "view".

I will check whether it depends on the title or vocabulary. do you have any ideas?

nicholasthompson’s picture

None whatsoever... What is your token template for the story node type configured as?

Witch’s picture

i set the default pattern [page-title] | [site-name]

Witch’s picture

May it be that there is a correlation between special chars like "? : ; ! etc." and the "View".

It seems to me that the title is wrong given, if some of these chars are inside the title. But i am definately not sure.

nicholasthompson’s picture

I'll have to take a look this weekend - I cant see ANY reason why this'd happen!

Witch’s picture

did you find any reason why this happens?

nicholasthompson’s picture

Status: Active » Postponed (maintainer needs more info)

Sorry - had a few REALLY busy weekends (barely had time to sleep).

Let me refresh my memory on this...

So you have Page Title 2-alpha5 installed. You have Tokens. You're running Drupal 5 (which sub-version?)... Have have ONLY the default page title pattern set (?) and it is set to [page-title] | [site-name]. Every page is picking up the Page Title (ie the in the ) as View, regardless of the page.

Could you possibly provide the _phptemplate_variables function in your template.php?

What happens if you change the default template? Does it have any effect?

Witch’s picture

StatusFileSize
new44.18 KB
new61.77 KB

Hi nicolas,

thank you that you try to solve this problem.
-Yes i have only the default pattern set.
- Changing the theme has no effect. The Error with "View" occurs with every theme i tried
- On some story nodes the title is correct given on other it shows "view"

At first i attached my drupal-configuration. The theme i use is Green n Black

These are the modules and version-numbers i inastalled:

Token 5.x-1.10
Panels 5.x-2.0-beta3 (My story nodes are panel pages)
Page Title 5.x-2.0-alpha5

nicholasthompson’s picture

could you provide the _phptemplate_variables function from your theme's template.php file?

Cheers

Witch’s picture

here it is

<?php



/**
* IE detector
*/
function greenNblack_ie_detect()
{
    if (isset($_SERVER['HTTP_USER_AGENT']) && 
    (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
        return true;
    else
        return false;
}

/**
* Add pngFix script to fix .png transparensy bug in IE6
*/

if (greenNblack_ie_detect()){
drupal_add_js(drupal_get_path('theme', 'greenNblack') . '/js/jquery.pngFix.js', 'theme');
}

/**
 * Sets the body-tag class attribute.
 *
 * Adds 'sidebar-left', 'sidebar-right' or 'sidebars' classes as needed.
 */
function greenNblack_container($L, $R) {

$class ='container';
    if ($L) {
      $class .= ' container-left';
    }
    if ($R) {
      $class .= ' container-right';
    }
 
 
    return ' class="'. $class .'"';
  
}

function greenNblack_footer($message){
$message.='<div id="author_link">Design by <a href="http://cmstuning.com/">CMStuning</a></div>';
return $message;
}

/**
* Declare own regiong in template
*/
function greenNblack_regions() {
  return array(
    'sidebar_right' => t('right sidebar'),
	'sidebar_left' => t('left sidebar'),
	'sub_header' => t('sub header'),
	'top_content' => t('content above nodes'),
	'content' => t('content'),
    'header' => t('header'),
	'top_menu' => t('top menu'),
    'footer' => t('footer')
	
  );
}

/**
* Altering search form
*/

function phptemplate_search_theme_form($form) {
$form['#prefix']='<div id="search" class="container-inline">';
$form['#suffix']='</div>';
unset ($form['submit']);
 
$form['search_theme_form_keys']['#title'] = t('Search');
 
return drupal_render($form);
}
?>
nicholasthompson’s picture

Status: Postponed (maintainer needs more info) » Fixed

So you dont have a _phptemplate_variables function?!

Unfortunately in Drupal there is no "hook" to allow a module to access the page level variables. This means you need to add an entry to th_phptemplate_variables function in template.php - but seeing as you dont have you, you need to create one... You should try reading the README.txt. Step 4 instructs on how to add the code to template.php.

If you need further help, please reply back to this post.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

TimeBandit’s picture

Version: 5.x-2.0-alpha5 » 5.x-1.1
Priority: Critical » Normal

i am having what appears to be the same or very similar issue except with 5.x-1.1.

I have a list view that displays: "node:title", "CCK imageField" and "node:body". Originally i had this setup to only show "node:title" and all was well with the page title tag. However, when i adjusted the list view to add in a "CCK imageField" and "node:body" i noticed the title tag changed. I ditched the CCK from the list to no avail. however when i deleted the node:body from the list the title tag reverted to what it should be.

I can recreate this issue by adding/deleting "node:body: from the fields displayed in this list view. When "node:body" is NOT present the title tag is correctly displaying "[whatever view name i chose] | [site name]", but when "node:body" is present the title tag reads "[title of last item in list] | [site name]"

What is more odd to me is that I have another list view set up, a glossary, which shows the node:title and node:body without causing any issues with the title tag. So it can't be simply the presence of node:body causing the issue. Also, both these views are using the same theme. Template.php contains:

function _phptemplate_variables($hook, $vars) {
  $vars = array();
  if ($hook == 'page') {

    // These are the only important lines
    if (module_exists('page_title')) {
      $vars['head_title'] = page_title_page_get_title();
    }

  }
  return $vars;
}
nicholasthompson’s picture

Version: 5.x-1.1 » 5.x-2.0-alpha5
Priority: Normal » Critical

This is actually a different issue completely. Your problem, TimeBandit, is actually due to PageTitle relying on nodeapi with the View operation. When a node if viewed (as it would be if the view includes the full node body I imaging) then its going to change the page title.

Please open a new issue for this if you need further support.