Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#21 | 1369852-set_page_title.patch | 553 bytes | Shaney |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedThe menu title of the node display should be the page title:
From node_menu():
Comment #2
kruser CreditAttribution: kruser commentedIt 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.
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedAll 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.
Comment #4
dbassendine CreditAttribution: dbassendine commentedJust 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:
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedThis actually needs to be fixed in CTools. I just checked in a fix there.
Comment #6
merlinofchaos CreditAttribution: merlinofchaos commentedComment #7
merlinofchaos CreditAttribution: merlinofchaos commentedAdjusting title; this is NOT unique to Panelizer at all.
Comment #9
neclimdulSeems like this should be back-ported. With the nod from earl I'll cherry-pick the commit back.
Comment #10
neclimduldone.
Comment #12
Isostar CreditAttribution: Isostar commentedExactly 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.
Comment #13
jtjones23 CreditAttribution: jtjones23 commentedI'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
Comment #14
Neo13 CreditAttribution: Neo13 commentedI can confirm the issue.
Comment #15
jessehsI 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.
Comment #16
dela.deyoungster CreditAttribution: dela.deyoungster commentedThanks @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".
Comment #17
joelstein CreditAttribution: joelstein commented#15 was the right approach for me, too. Thanks!
Comment #18
joelstein CreditAttribution: joelstein commentedComment #19
nicholsj CreditAttribution: nicholsj commented(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
and drupal_get_title:
Any suggestions much appreciated
Comment #20
geophysicist CreditAttribution: geophysicist as a volunteer commentedI found best solution for this issue. If you want to use last CTools module version and do not patch it - just create your own custom module or use existing one with system weight less then 0 and implement there hook_node_view where you can call drupal_set_title($node->title).
It helps me with my issue - wrong og:title tag.
Comment #21
Shaney CreditAttribution: Shaney commentedI've tracked down the cause of this. It's due to the refactoring of the page_manager_node_view_page($node) function in the node_view task from page manager.
Previous to version 7.x-1.8 the node title was set early in the function, before any attempts to generate content. This was done either by the node being explicitly set via drupal_set_title($node->title), or the default content being generated by $default_output = node_page_view($node); which sets the title.
Now the default content is only generated if the page_manager fails to render its version. So at the point the page manager content is generated, no title has been explicitly set.
We can then see from drupal_get_title() that that it falls back to the active menu title. Weirdness ensues.
To keep the benefits of not rendering the default content, adding a direct call to drupal_set_title early in the function seems a simple solution. Have attached a patch
Comment #22
rivimeyShaney, thanks for your patch, it looks reasonable.
Is there a chance of you adding simpletests for this functionality, as this area seems prone to getting broken!
Comment #23
darrenwh CreditAttribution: darrenwh as a volunteer and at Investis Digital commentedNeeds tests
Comment #24
Anybody#21 works great. The issue still exists and is really weird... simpletest would be very nice but the current behaviour is even worse since 12 month... so if nothing changed I think an RTBC would be better than a test ... ;)
+1 for RTBC!
Comment #25
rivimeyComment #26
geek-merlinComment #27
uq CreditAttribution: uq commented#21's working well with Page Manager 7.x-1.12.
Comment #28
rivimey@axel.rutz Please explain the regression risk.
Comment #29
rivimeyComment #30
joelpittetComment #31
joelpittetClosing as a duplicate of #2673298: On node edit page, the menu link title is used for the page title (rather than the actual page title)
Comment #32
jordisan CreditAttribution: jordisan commentedPlease, note that the issue linked as duplicated is about nodes being edited, but this issue is for nodes being viewed, which I think is NOT fixed (the patch in #21 seems to work though).