Instead of printing the h1 in the page template I usually add it through panels, for ease of layout. In the 7 alpha though the node title isn't used, instead it's the menu link name that shows up.

Add content->Page Elements->Page Title outputs:

<div class="panel-pane pane-page-title">
  <div class="pane-content">
    <h1>[MENU TITLE]</h1>
  </div>
</div>

When using the title override property and using replacement %node:title the pane seems to work like other panes and output an h2 instead of changing the h1, as seen here:

<div class="panel-pane pane-page-title">
      <h2 class="pane-title">[NODE TITLE]</h2>
  <div class="pane-content">
    <h1>[MENU TITLE]</h1>
  </div>
</div>

Comments

damienmckenna’s picture

Am seeing something like this too.

bobodrone’s picture

Project: Panels » Chaos Tool Suite (ctools)
Version: 7.x-3.0-alpha3 » 7.x-1.x-dev
Assigned: Unassigned » bobodrone
Status: Active » Needs review

It is actually an issue in ctools.

Here is a small patch that solves the problem by adding a drupal_set_title() in: ctools > page manager > plugins > task > node_view.inc.

/ Bobodrone

bobodrone’s picture

And the patch is here...

bobodrone’s picture

Component: Code » Page Manager
barraponto’s picture

Fixed as a workaround, but shouldn't we prevent it from setting page title to menu title?

bobodrone’s picture

I agree. First of all, this is actually a core issue with the functions drupal_get/set_title. But for now we need to copy the behavior that core node/term uses to solve this problem by encforing the title.

The problem seems to be in the function "drupal_get_title()" (bootstrap.inc:1782). The function first calls the "drupal_set_title()" to get an cached title. If no cached title is returned AND the function "menu_get_active_title()" is accesible the function drupal_get_title() returns the menu item title instead.
Therefore, right now, we need to enforce the cached title by setting it for node/term override pages in panels/page manager. But we should try to rewrite this in some way in core. There are however some core/contrib-files that calls the drupal_get_title that we need to take in account when rewriting it (common.inc, theme.inc & ctools page title content type for example).

bootstrap.inc:1782:

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;
}

/ bobodrone

barraponto’s picture

It only sets the page title to the current menu title if page title isn't set.

So does page manager prevent title callback from running? Does it render page contents before title callback runs? page_manager_node_view_menu_alter() does nothing to title callback... except for changing the loaded file. Maybe that breaks title callback.

barraponto’s picture

Confirmed setting the file to something else prevents node_page_title from running.

But adding a title_callback to ctools/page_manager/plugins/tasks/node_view.inc and setting the menu item title callback to it is not enough, it still prints the menu link title.

Go figure. Here is a patch that at least calls a title callback :/

barraponto’s picture

I bet it is now related to setting the pane title, see http://imm.io/e2eY
Can we get a "Leave the title alone" option?

merlinofchaos’s picture

Status: Needs review » Closed (duplicate)

I believe this is #1369852: Page Manager displays menu title instead of node title which is very recently fixed.