Make Page Title show proper titles for Panels -- requires Token cache fix

mindgarden - February 8, 2009 - 00:20
Project:Page Title
Version:6.x-2.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Description

How come no titles are showing in my panels? I have hundreds of panel nodes. Installed the code per README file, still nothing happens.

#1

nicholasThompson - February 8, 2009 - 11:21
Category:task» bug report
Status:active» postponed (maintainer needs more info)

AFAIK It should work with Panels (I assume Panels 2?)... I'll have to investigate.

#2

mindgarden - February 8, 2009 - 22:00

Yes, I meant Panels 2.

It's not yet working?

#3

EvanDonovan - May 29, 2009 - 18:08
Title:Doesn't work with Panels?» Limit page_title_preprocess_page to node pages (was: Doesn't work with Panels?)
Status:postponed (maintainer needs more info)» needs review

I was also experiencing this error. After enabling Page Title, I found that all my panel page titles were of the form "Home | [Site Name]".

I discovered that this was because page_title_preprocess_page() was calling page_title_page_get_title() on every page, and that function doesn't seem to work properly when arg(0) !== 'node'.

Attached is a one-liner patch that resolves the issue by limiting page_title_preprocess_page() to operate when arg(0) == 'node'. I think this is a good solution, for now at least, since Page Title doesn't seem currently to include patterns for anything besides node pages.

AttachmentSize
page_title.patch 458 bytes

#4

EvanDonovan - June 26, 2009 - 18:04

Has anyone had a chance to review this patch? I see that there's a 2.2 version of the module now and it still hasn't been reviewed on here or committed. I will test after I upgrade my site to 2.2 & see whether the patch is still necessary. If so, I will report back here & bump the version number on this issue.

#5

brianbrown - July 1, 2009 - 13:50
Version:6.x-2.0» 6.x-2.x-dev
Status:needs review» reviewed & tested by the community

Hi Evan!
The issue still appears in the current 2.x-dev version. I can, however, confirm that the above patch works correctly in that version.
Thanks!
-Brian

#6

EvanDonovan - July 1, 2009 - 14:35

I just upgraded my page_title.module & I can confirm that the patch still applies and works in Page Title 2.2. So, unless there's any objections to this approach, can this be committed to the module?

#7

Nick Urban - October 2, 2009 - 22:16

The problem with that patch is that page_title supports other things like blogs, users, etc.

Here is a patch for the way I solved panels compatibility, which I think shouldn't remove any of the functionality from other page types.

This should be applied to page_title.module.

Nick

AttachmentSize
page-title.patch 614 bytes

#8

EvanDonovan - October 2, 2009 - 22:46
Status:reviewed & tested by the community» needs review

Thanks for the patch! I'll test it soon - changing status to "needs review" accordingly. I only used Page Title for nodes, but I can understand now why my patch wouldn't be sufficient for everyone.

#9

EvanDonovan - October 2, 2009 - 22:47
Version:6.x-2.x-dev» 6.x-2.2

I forgot to change version to 2.2, which is what I'm using. Or was this patch against the -dev?

#10

EvanDonovan - October 2, 2009 - 22:49
Title:Limit page_title_preprocess_page to node pages (was: Doesn't work with Panels?)» Make Page Title compatible with Panels

Sorry to comment again, I realized that the new patch changes the scope of the issue slightly, so I should rename it (since it's not limiting page_title_preprocess_page to nodes).

#11

tobiberlin - October 10, 2009 - 09:40

I just want to add that I use Page title as well and realized that my panel pages show no titles any more. I used to define the titles by drupal_set_title and even in this way the titles are not defined as long as page title is installed.

#12

crea - October 15, 2009 - 16:30
Title:Make Page Title compatible with Panels» Some weird patch

Page Title IS compatible with Panels (atleast for 3.x version of Panels it is 100% compatible). There is just one bug preventing it to work. See #529186: Usage of global token breaks default page titles because of early Token caching.
This issue' title doesn't make any sense.

#13

EvanDonovan - October 15, 2009 - 19:25
Title:Some weird patch» Make Page Title show proper titles for Panels

Please refrain from making issue titles completely meaningless. For many of us, Page Title was *not* compatible with Panels because it overrode the titles of pages with nonsense (i.e., "Home"). You could have called attention to your fix - which I will test - without changing the title.

#14

EvanDonovan - October 15, 2009 - 19:27

If your fix fixes this issue, as well as others, then I will mark this one as duplicate. But my patch in #3, and the later versions, worked for a particular case.

#15

crea - October 16, 2009 - 02:12

Sorry, I didn't mean to affend you. It works for me, and I don't have any issues. Page Title should not be made "compatible", cause it has "default title" concept, and it should fallback to default if there is no specific replacement rule. Actually it's probably same way for any titles set up by other modules, e.g. Views pages titles should work same way. The only problem is this concept doesn't work because of the token cache bug. With the workaround for this bug, Page Title simply uses what Panels (or any other module) sets up. Making specific "compatible" patches doesn't make sense when there's general mechanics for all modules to set title that should just work, but doesn't because of a bug.

#16

EvanDonovan - October 16, 2009 - 14:35

Ok, thanks for the clarification. I'm just saying you could have said that to begin with, rather than trying to make a point with your change to the title. You make a good case; I just wasn't aware of the root cause of the bug.

#17

EvanDonovan - October 16, 2009 - 14:42
Title:Make Page Title show proper titles for Panels» Make Page Title show proper titles for Panels -- requires Token cache fix
Status:needs review» needs work

I decided not to switch to using your workaround because of the performance implications. I'll wait until a better solution can be found. I've updated issue title accordingly.

 
 

Drupal is a registered trademark of Dries Buytaert.