I have a node assigned to the front page (so FP is /node/1). The page_title settings have no effect and the page title simply defaults to the site name. I've tried setting the page title for the node in question as well as filling in the front page box on the page_title settings page, using both tokens and plain text and I can never get it to change.

I'm using the waffles theme, based on acquia_marina.

Comments

nicholasthompson’s picture

Status: Active » Closed (won't fix)

It appears the Acquia Marina theme (and therefore Waffles) play about with the Page Title in the template.php... I'll have to submit a patch so that gets bypassed if Page Title is installed...

I've set this to "Wont Fix" mainly because there is a "cant fix" ;-)

ergophobe’s picture

Thanks - I've been trying to trace this and basically found the same thing - page-title returns the correct title, but it has no effect when using this theme.

ergophobe’s picture

Okay, I commented out the parts of Acquia that modify page title. Strange though b/c in theory it checks to see whether or not page_title is active and shouldn't overwrite custom titles (it works correctly with nodewords).

arax28’s picture

Same bug found with Zen 1.11.2.1 theme.

jazfx’s picture

Component: Code » User interface

Found that you can edit this from admin/content/page_title. Should be worked into the node edit area.

Anonymous’s picture

Version: 6.x-2.2 » 6.x-2.3
Component: User interface » Code
Status: Closed (won't fix) » Active

Reopening. This is not a theme problem (at least, it isn't in 6.x.2.3). Changing to a core theme does not solve it.

The problem is that the code in page_title_page_get_title() says (paraphrased):

if frontpage {
use frontpage settings
} else {
use node-type settings
}

So the front page settings always trump all else. It's easy to solve by taking out the "else".

The question is, should node-type settings override frontpage settings or not?

(Note in the latest dev version, I the implementation is different, but the outcome is the same. See: page_title_page_title_pattern_alter in page_title.page_title.inc).

Anonymous’s picture

Status: Active » Closed (won't fix)

It's just been pointed out to me that you can also solve this by removing the default configuration in "Frontpage Global" settings.

Closing again. *Blush*

Oceanman’s picture

I found this thread when I was having a problem with my titles showing on the home page. My solution was found when I put the correct token in the Frontpage.

Go to this page admin/settings/page-title and there you can set the token for the "Frontpage" and I added [page-title] and it worked for each of my 4 custom (different language) home pages.

justinlevi’s picture

Version: 6.x-2.3 » 7.x-2.5

I ran into this issue but it's pretty easy to fix. Most likely the override is happening in template.php in the THEME_preprocess_html function so just do a search for 'head_title' and comment out any line that is setting the title.

example:

function MYTHEME_preprocess_html(&$vars) {
  $vars['classes_array'][] = 'theme-markup-2';
  $vars['classes_array'][] = _x_get_layout();
  //$vars['head_title'] = implode(' | ', array(drupal_get_title(), variable_get('site_name'), variable_get('site_slogan')));  
}
damonlevine’s picture

None of what's mentioned above actually fixes the issue

BeaPower’s picture

I am also having the same problem, any fix?

BeaPower’s picture

@justinlevi, Im using the bartik theme. How do I change?

<?php

/**
 * Add body classes if certain regions have content.
 */
function bartik_preprocess_html(&$variables) {
  if (!empty($variables['page']['featured'])) {
    $variables['classes_array'][] = 'featured';
  }

  if (!empty($variables['page']['triptych_first'])
    || !empty($variables['page']['triptych_middle'])
    || !empty($variables['page']['triptych_last'])) {
    $variables['classes_array'][] = 'triptych';
  }

  if (!empty($variables['page']['footer_firstcolumn'])
    || !empty($variables['page']['footer_secondcolumn'])
    || !empty($variables['page']['footer_thirdcolumn'])
    || !empty($variables['page']['footer_fourthcolumn'])) {
    $variables['classes_array'][] = 'footer-columns';
  }

  // Add conditional stylesheets for IE
  drupal_add_css(path_to_theme() . '/css/ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte 

IE 7', '!IE' => FALSE), 'preprocess' => FALSE));
  drupal_add_css(path_to_theme() . '/css/ie6.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'IE 

6', '!IE' => FALSE), 'preprocess' => FALSE));
}

/**
 * Override or insert variables into the page template for HTML output.
 */
function bartik_process_html(&$variables) {
  // Hook into color.module.
  if (module_exists('color')) {
    _color_html_alter($variables);
  }
}

/**
 * Override or insert variables into the page template.
 */
function bartik_process_page(&$variables) {
  // Hook into color.module.
  if (module_exists('color')) {
    _color_page_alter($variables);
  }
  // Always print the site name and slogan, but if they are toggled off, we'll
  // just hide them visually.
  $variables['hide_site_name']   = theme_get_setting('toggle_name') ? FALSE : TRUE;
  $variables['hide_site_slogan'] = theme_get_setting('toggle_slogan') ? FALSE : TRUE;
  if ($variables['hide_site_name']) {
    // If toggle_name is FALSE, the site_name will be empty, so we rebuild it.
    $variables['site_name'] = filter_xss_admin(variable_get('site_name', 'Drupal'));
  }
  if ($variables['hide_site_slogan']) {
    // If toggle_site_slogan is FALSE, the site_slogan will be empty, so we rebuild it.
    $variables['site_slogan'] = filter_xss_admin(variable_get('site_slogan', ''));
  }
  // Since the title and the shortcut link are both block level elements,
  // positioning them next to each other is much simpler with a wrapper div.
  if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) {
    // Add a wrapper div using the title_prefix and title_suffix render elements.
    $variables['title_prefix']['shortcut_wrapper'] = array(
      '#markup' => '<div class="shortcut-wrapper clearfix">',
      '#weight' => 100,
    );
    $variables['title_suffix']['shortcut_wrapper'] = array(
      '#markup' => '</div>',
      '#weight' => -99,
    );
    // Make sure the shortcut link is the first item in title_suffix.
    $variables['title_suffix']['add_or_remove_shortcut']['#weight'] = -100;
  }
}

/**
 * Implements hook_preprocess_maintenance_page().
 */
function bartik_preprocess_maintenance_page(&$variables) {
  if (!$variables['db_is_active']) {
    unset($variables['site_name']);
  }
  drupal_add_css(drupal_get_path('theme', 'bartik') . '/css/maintenance-page.css');
}

/**
 * Override or insert variables into the maintenance page template.
 */
function bartik_process_maintenance_page(&$variables) {
  // Always print the site name and slogan, but if they are toggled off, we'll
  // just hide them visually.
  $variables['hide_site_name']   = theme_get_setting('toggle_name') ? FALSE : TRUE;
  $variables['hide_site_slogan'] = theme_get_setting('toggle_slogan') ? FALSE : TRUE;
  if ($variables['hide_site_name']) {
    // If toggle_name is FALSE, the site_name will be empty, so we rebuild it.
    $variables['site_name'] = filter_xss_admin(variable_get('site_name', 'Drupal'));
  }
  if ($variables['hide_site_slogan']) {
    // If toggle_site_slogan is FALSE, the site_slogan will be empty, so we rebuild it.
    $variables['site_slogan'] = filter_xss_admin(variable_get('site_slogan', ''));
  }
}

/**
 * Override or insert variables into the node template.
 */
function bartik_preprocess_node(&$variables) {
  if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) {
    $variables['classes_array'][] = 'node-full';
  }
}

/**
 * Override or insert variables into the block template.
 */
function bartik_preprocess_block(&$variables) {
  // In the header region visually hide block titles.
  if ($variables['block']->region == 'header') {
  $variables['title_attributes_array']['class'][] = 'element-invisible';
  }
}

/**
 * Implements theme_menu_tree().
 */
function bartik_menu_tree($variables) {
  return '<ul class="menu clearfix">' . $variables['tree'] . '</ul>';
}

/**
 * Implements theme_field__field_type().
 */
function bartik_field__taxonomy_term_reference($variables) {
  $output = '';

  // Render the label, if it's not hidden.
  if (!$variables['label_hidden']) {
    $output .= '<h3 class="field-label">' . $variables['label'] . ': </h3>';
  }

  // Render the items.
  $output .= ($variables['element']['#label_display'] == 'inline') ? '<ul class="links inline">' : '<ul 

class="links">';
  foreach ($variables['items'] as $delta => $item) {
    $output .= '<li class="taxonomy-term-reference-' . $delta . '"' . $variables['item_attributes'][$delta] . 

'>' . drupal_render($item) . '</li>';
  }
  $output .= '</ul>';

  // Render the top-level DIV.
  $output = '<div class="' . $variables['classes'] . (!in_array('clearfix', $variables['classes_array']) ? ' 

clearfix' : '') . '">' . $output . '</div>';

  return $output;
}
BeaPower’s picture

same here

Darshan4389’s picture

Issue summary: View changes

I was not able to change the front page title of my drupal 8 site
I have done it by Jquery, and used the following code in the front page twig file.

document.title="new title";

It worked for me