After I Panelize a node, on the node display, it starts displaying the Menu title as the Page title instead of the Node's title.

Comments

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

The menu title of the node display should be the page title:

From node_menu():

  $items['node/%node'] = array(
    'title callback' => 'node_page_title', 
    'title arguments' => array(1),
    // The page callback also invokes drupal_set_title() in case
    // the menu router's title is overridden by a menu link. 
    'page callback' => 'node_page_view', 
    'page arguments' => array(1), 
    'access callback' => 'node_access', 
    'access arguments' => array('view', 1),
  );
kruser’s picture

It seems strange that before it is panelized, the node shows the node's title, then after it's panelized, it starts using the Menu link title. See the Screencapture: http://screencast.com/t/ltKuIxwc

Once that happens, you can't change to the title on the page without changing the menu link title.

merlinofchaos’s picture

Status: Postponed (maintainer needs more info) » Active

All right. It does appear that http://api.drupal.org/api/drupal/modules--node--node.module/function/nod... does an additional title set that I didn't realize it needed to do. That'll mean fixing the API to properly set the title from an entity. That shouldn't be too difficult, I think.

dbassendine’s picture

Just to note this issue also affects the 6.x version.

I'm not familiar enough with Panels or Panelizer to take a crack at this directly, but here's a temporary workaround to revert this in the theme layer:

/**
 * Preprocess panel pane
 */
function themename_preprocess_panels_pane(&$vars) {
  // Override Panelizer's page title override
  if ($vars['display']->context['panelizer']->data->title) {
    drupal_set_title($vars['display']->context['panelizer']->data->title);
  }
}
merlinofchaos’s picture

Status: Active » Fixed

This actually needs to be fixed in CTools. I just checked in a fix there.

merlinofchaos’s picture

Project: Panelizer » Chaos tool suite (ctools)
Version: 7.x-2.0-beta2 » 7.x-1.x-dev
merlinofchaos’s picture

Title: Panelizer displays menu title instead of node title » Page Manager displays menu title instead of node title

Adjusting title; this is NOT unique to Panelizer at all.

Status: Fixed » Closed (fixed)

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

neclimdul’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Closed (fixed) » Patch (to be ported)

Seems like this should be back-ported. With the nod from earl I'll cherry-pick the commit back.

neclimdul’s picture

Status: Patch (to be ported) » Fixed

done.

Status: Fixed » Closed (fixed)

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

Isostar’s picture

Version: 6.x-1.x-dev » 7.x-1.9
Issue summary: View changes
Status: Closed (fixed) » Active

Exactly the same bug seems active again in 7.x-1.9
I use the page title panel in websites with panels everywhere.

Problem was seen after upgrading from 1.7 -> 1.9. (Tested on several sites)
After downgrading problem was gone.

jtjones23’s picture

I'm seeing the same issue after upgrading from 1.7 -> 1.9. After downgrading to 1.7, the problem goes away.

Update: Solved by disabling the Menu Position module and using Custom Breadcrumbs instead. Now I can use ctools 7.x-1.9

Neo13’s picture

I can confirm the issue.

jessehs’s picture

I encountered an issue where the Panels default content had a title that was left empty. (The "Title type" option was "Manually set".) When a node had a menu item, the menu item appeared as the page title. If I changed the title of the panels page to "%node:title" the problem was solved.

This problem existed for the node_view panels page default display as well as the Panelizer default configuration.

Also note that the site was using the Menu Position module, although I did not confirm whether disabling it changed anything.

EDIT: Out of curiosity I tried disabling Menu Position, and it did not fix the issue.

dela.deyoungster’s picture

Thanks @Jessehs. Your suggestion of using the %node:title for the panels page worked great for me ;). I was having this issue while working with Open Atrium.

Cheers,
Dela.

PS:
The setting for the panels page title is found under: "admin/structure/types/manage/[node-type]/panelizer/page_manager/content".

joelstein’s picture

#15 was the right approach for me, too. Thanks!

joelstein’s picture

nicholsj’s picture

(Apologies if this should be logged as a new issue - but from what I can tell it's related to the above)

(Drupal 7.43)

Since upgrading Ctools module from 1.4 to 1.9 we've got a problem with title fields not displaying on our Press Relase content type.

Instead of "Press Release: [title of press release]"
we're getting "Press Release: [parent menu title]"

Reverting to Ctools 1.7 solves the issue, 1.8 onwards causes it.

Here's the relevant snippet from \preprocess\node.preprocess.inc

if($publish_date < strtotime('-1 year')) {
          $variables['title'] = t('Archived press release') . '<br />' . drupal_get_title();
        } else {
          $variables['title'] = t('Press release') . '<br />' . drupal_get_title();
        }

and drupal_get_title:

 function drupal_get_title() {
    $title = drupal_set_title();
      // During a bootstrap, menu.inc is not included and thus we cannot provide a title.
    if (!isset($title) && function_exists('menu_get_active_title')) {
    $title = check_plain(menu_get_active_title());
    }
    return $title;
    }

Any suggestions much appreciated