Hi,

When I install page_title on a regular node, it is working ok. So it is no issue in page_title module.
When I implement panels node_override (node/%) everything works ok, except the page_title is not shown as tag, but the normal node_title.
Has this to do with module-weight? Or is it related to: http://drupal.org/node/268318 Or is it a seperate issue?

Thanks in advance for going into this!

greetings,
Martijn

CommentFileSizeAuthor
#22 page_title.tgz14.44 KBjenlampton
#11 page_title.patch2.28 KBdkruglyak

Comments

Vidarls’s picture

This is because when you use panels to override the node/% url, the page loaded is no longer a node, it is a panels page. Modules that expect a node page to be loaded, and not a panels page will not behave as they are intended to when using panel node/% override. I believe that it is mostly modules that tries to modify the "menu" part of any node (I'm lacking in my english here; what I mean is for example breadcrumbs, menu entries and titles) that will fail when using panels node/% override. Modules that modifies other part of the node (CCK, links, filters etc) are generally not affected by panels.

A possible solution for you might be using workflow-ng (http://drupal.org/project/workflow_ng) to set the page title to a custom value during page load. I have described a way of doing that in this issue: #274004-2: Panel pages and breadcrumbs regarding breadcrumbs. But you can basically use the same approach to page titles, replacing the set breadcrumb action with set page title action.

Vidarls’s picture

Category: bug » support

Changing this to a support request.
@summit: you could raise an issue against page_title module with a feature request to support panels pages

summit’s picture

Hi Vidar,

Could you explain with code exactly what I have to do to get this working for page_title?
Thanks in advance for your reply!

greetings,
Martijn

Vidarls’s picture

I'm not sure what you're after. There is no coding incolved in setting workflow_ng up to set the page title.

I don't know what is required to make page_title module support panel pages if that is what you are after.

sun’s picture

Project: Panels » Page Title
Version: 5.x-2.0-beta5 » 5.x-2.x-dev

Moving over to Page Title project. Panels is not able to do anything about this issue.

nicholasthompson’s picture

Category: support » bug
Status: Active » Postponed (maintainer needs more info)

Can you please confirm what versions of modules/core you are using here please so I can try to accurately replicate?

nicholasthompson’s picture

Title: Page_title from page_title module not working with node-override » Panels 2 + Page Title 2 + Panel for node/% = no page title overriding
Status: Postponed (maintainer needs more info) » Active

I think I understand the problem - marking as active as I'm investigating this....

jenlampton’s picture

Title: Panels 2 + Page Title 2 + Panel for node/% = no page title overriding » Request for Panels Integration
Category: bug » feature

I think what everyone wants (me too, me too!) is Panels integration. I.E. a field on the build/panels page that lets you set a custom page title for that panel. NodeWords (aka Meta Tags) also has an example of how to do this...

/**
 * Implementation of hook_form_alter().
 */
function nodewords_form_alter($form_id, &$form) {
...
elseif ($form_id == 'panels_edit_form') {
    $type = 'panels';
    $id = $form['did']['#value'];
    $form['submit']['#weight'] = 45;
    $form['#submit']['nodewords_panels_handler'] = array();
  }
...
}
/**
 * Handling of edit/delete form for panels.
 */
function nodewords_panels_handler($form_id, $form_values) {
  switch ($_POST['op']) {
    case t('Save'):
      if (isset($form_values['nodewords']) && user_access('administer meta tags')) {
        _nodewords_set('panels', $form_values['did'], $form_values['nodewords']);
      }
      break;

    case t('Delete'):
      if ($form_values['confirm']) {
        _nodewords_delete('panels', $form_values['did']);
      }
      break;
  }
}
/**
 * Handling of edit/delete form for panels (v2).
 */
function nodewords_panels_page_handler($form_id, $form_values) {
  switch ($_POST['op']) {
    case t('Save'):
      if (isset($form_values['nodewords']) && user_access('administer meta tags')) {
        _nodewords_set('panels', $form_values['panel_page']->did, $form_values['nodewords']);
      }
      break;

    case t('Delete'):
      if ($form_values['confirm']) {
        _nodewords_delete('panels', $form_values->did);
      }
      break;
  }
}
function nodewords_get($type = NULL, $ids = NULL, $filtered = TRUE) {
...
  // Load the values from the database
  if (count($ids) == 1 && ($type != 'node' || node_access('view', node_load($ids[0])))) {
    $tags = _nodewords_load($type, $ids[0]);
  }
  else {
    $tags = array();
  }
...
  // Prepare tags for output
  $tags = _nodewords_prepare($type, $ids, $tags, $filtered);

  return $tags;
}

also take a look at the _nodewords_detect_type_and_ids() function.
Jen

jenlampton’s picture

Assigned: Unassigned » jenlampton
Status: Active » Needs review

I added panels integration in my update to this module, available here:
http://drupal.org/node/284218#comment-1077364

Jen

wflorian’s picture

+subscribe

dkruglyak’s picture

Version: 5.x-2.x-dev » 6.x-2.x-dev
Category: feature » task
Priority: Normal » Critical
StatusFileSize
new2.28 KB

Since I happen to need this integration immediately I just bit the bullet and developed it!

This is not a polished solution, but a quick hack that gets the job done for me. The idea is to add another condition check in page_title_get_title() and if the active menu matches panel's delegator, emulate its handler code to construct and retrieve the page title.

Note, my fix works with Panels 3, which is the only version that will be supported going forward.

wflorian’s picture

Is the patch also working for D5 versions?

dkruglyak’s picture

No, this patch is only for Panels 6.x-3.x, which is a complete rewrite of Panels.

jenlampton’s picture

Assigned: jenlampton » Unassigned

I haven't worked on this since last year, silly to keep it assigned to me!
thanks dkruglyak for taking over!
Jen

pyxio’s picture

Yes, this pretty important. I'm curious if and when the patch will be integrated into a module release. I don't liked patching if I don't have to. Thanks for the fantastic module ... especially the term page titles introduced in the last release. awesome! cheers, kevin

wflorian’s picture

Anybody out there who is also still interested in a working solution for Panels 2 for Drupal 5.x.

Maybe somebody is capable of doing a backport? I would be willing to support your work with a little extra money.

crea’s picture

Patch from #11 needs work anyway cause there is no more delegator but page_manager is.
Subscribing

crea’s picture

Actually, I don't understand why Page Title doesn't work for Panels: Panels set up page title via drupal_set_title() and it should be available in Page Title module, cause it uses drupal_get_title() for fallback in page_title_get_title(). But for some reason drupal_get_title() returns wrong title there (from menu_get_active_title() function). Trying to investigate that atm.

crea’s picture

Title: Request for Panels Integration » Page Title breaks Panels titles
Category: task » bug
Priority: Critical » Normal
Status: Needs review » Active

Setting it as active bug, cause I think there should not be any "integration" as Panels itself sets up titles properly via drupal_set_title() and Page Title module only needs to play nice with it.

crea’s picture

Title: Page Title breaks Panels titles » Page Title breaks Panels page titles
crea’s picture

Title: Page Title breaks Panels page titles » Panels Integration for 5.x
Version: 6.x-2.x-dev » 5.x-2.x-dev
Category: bug » feature

Let's deal with 6.x issues separately and leave this for 5.x version as it was originally before dkruglyak spoiled it.

jenlampton’s picture

StatusFileSize
new14.44 KB

I have a version of this module I managed to get working with Panels 5.x-1.2. I started working on it back in Page Title 5.x-2.0 but a lot has changed since then!

I thought I would have had more time since then to do a diff and see if I could merge my changes back into head for the 5.x branch, but since I don't seem to be getting around to it, this is my Page Title 5.x-2.0 version. It "works" but I'd love it if any of you devs with more time could take over and get it up to snuff for the community.

Sorry again for my tardiness!
Jen

summit’s picture

Subscribing, will look into your module Jen for a Drupal 5 site of mine.

EDIT: Hi, I am not able to get it working. it gives a taxonomy pages option, but NO panel-pages support with my small knowledge..
sorry if I am mistaken..

Greetings,
Martijn

nicholasthompson’s picture

Status: Active » Closed (won't fix)

I've decided that 2.3 shall be the last of the DRUPAL-5 releases. I simply do not have the bandwidth or energy to maintain that branch anymore. If anyone wishes to become a co-maintainer for the DRUPAL-5 branch, please contact me.