Panels Integration for 5.x

Summit - June 29, 2008 - 13:54
Project:Page Title
Version:5.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

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

#1

Vidar Løvbrekke... - June 30, 2008 - 21:05

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.

#2

Vidar Løvbrekke... - June 30, 2008 - 21:07
Category:bug report» support request

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

#3

Summit - July 1, 2008 - 07:19

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

#4

Vidar Løvbrekke... - July 1, 2008 - 21:41

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.

#5

sun - September 12, 2008 - 22:01
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.

#6

nicholasThompson - September 25, 2008 - 14:27
Category:support request» bug report
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?

#7

nicholasThompson - September 25, 2008 - 16:34
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....

#8

jenlampton - October 21, 2008 - 03:28
Title:Panels 2 + Page Title 2 + Panel for node/% = no page title overriding» Request for Panels Integration
Category:bug report» feature request

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

#9

jenlampton - October 26, 2008 - 00:37
Assigned to:Anonymous» 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

#10

wflorian - February 8, 2009 - 14:33

+subscribe

#11

dkruglyak - June 18, 2009 - 07:49
Version:5.x-2.x-dev» 6.x-2.x-dev
Category:feature request» task
Priority:normal» critical

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.

AttachmentSize
page_title.patch 2.28 KB

#12

wflorian - June 18, 2009 - 18:38

Is the patch also working for D5 versions?

#13

dkruglyak - June 18, 2009 - 22:13

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

#14

jenlampton - June 21, 2009 - 06:57
Assigned to:jenlampton» Anonymous

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

#15

iteego - June 25, 2009 - 13:42

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

#16

wflorian - July 19, 2009 - 10:32

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.

#17

crea - July 23, 2009 - 14:45

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

#18

crea - July 23, 2009 - 15:22

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.

#19

crea - July 23, 2009 - 16:14
Title:Request for Panels Integration» Page Title breaks Panels titles
Category:task» bug report
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.

#20

crea - July 23, 2009 - 16:15
Title:Page Title breaks Panels titles» Page Title breaks Panels page titles

#21

crea - July 23, 2009 - 18:04
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 report» feature request

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

#22

jenlampton - August 6, 2009 - 05:18

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

AttachmentSize
page_title.tgz 14.44 KB

#23

Summit - September 11, 2009 - 09:28

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

 
 

Drupal is a registered trademark of Dries Buytaert.