Closed (fixed)
Project:
Panels
Version:
5.x-2.x-dev
Component:
Panel pages
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
9 Jun 2008 at 06:18 UTC
Updated:
22 Nov 2008 at 22:55 UTC
Jump to comment: Most recent file
Ever since beta5, any new node context panel pages are displaying the home page title instead of the node's title. We used to be able to pass the node's title through with a keyword argument, but this no longer seems to be honored.
I hope I'm making sense.
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | panels_page.page-title-v2.patch | 2.09 KB | smk-ka |
| #15 | panels_page.page-title-v2.patch | 2.13 KB | smk-ka |
| #14 | panels_page-page-title.patch | 1.05 KB | smk-ka |
| #13 | panels-title.patch | 762 bytes | jody lynn |
| #9 | Picture 5.png | 46.04 KB | zach harkey |
Comments
Comment #1
zach harkey commentedOk, it looks like if I go into the Context tab and delete and recreate my Node ID argument, and re-enter the Title: %KEYWORD and Keyword values, my context node panel overrides will have proper page titles (the node's title will display as the page's title in the browser window). But the result is never permanent. If I continue to administer my pane configurations, the overridden node's page titles invariably revert back to the default "slogan | site name" instead of the "node title | site name".
I can't seem to figure out a pattern to what is causing this.
Comment #2
zach harkey commentedOk, I think I see how this is working now. Somewhere along the way each content type was given its own "Panel Title" field under Layout settings. (Maybe it was always this way, this module messes with my head like no other.)
So, if I understand this correctly, for node override panels, (i.e. panel page set with Path: node/% and Node ID added as the first context argument), if you want the page title (including the html head title for the browser) to be the title of the node being viewed you must do the following:
Under "Layout Settings" there will be a Default tab along with a tab for each content type you enabled.
Each of these tabs has its own panel "Title" field. (Note: this "Panel Title" fieldset currently appears way down the page for Flexible layout types, where it is difficult to see. Also note that this fieldset does not appear at all if you have left the "Page title" field blank under the main Settings tab).
In the Title field for each content type you must enter: %node. Even though the help text seems to indicate that you can leave it blank, you can't.
Also, even though it would seem that checking "Hide title" would simply prevent the display of the $title on the page, it actually replaces the node's title with some other value (in my case: View) and continues to displays it. I think this is a bug.
I'm really not sure where I'm going with this thread. I guess it is no longer a 'bug' report, but this information was such a bitch for me to figure out that I'm reluctant to close it just yet, in case others are experiencing the same hell as I was. Maybe the above steps can be merged into the documentation or something. For now, I'm going to tweak the issue title and status.
Comment #3
zach harkey commentedThere.
Comment #4
sunConfirming. If more than one content-type is enabled, and at least one content-type has an "own" display, the node's title for this separate ("own") content-type is
1) not output at all, even if both a Panel title (in settings) and Display title (in layout settings) is set.
2) output as page title AND page heading ($title) if a Display title (in layout settings) is configured, but "Hide title?" is NOT enabled.
3) replaced by the term "View" and output as page title AND page heading if a Display title is configured and "Hide title?" is enabled.
btw: #213751: $node->title removed from template variables does not resolve this issue.
Comment #5
sunI've vardumped my way through Panels a bit now - some facts:
a) panels_page_view_page() retrieves and sets the correct context, keywords, and title in line 786:
b) Even if I configure the Panel to disable regular Drupal regions, and also even if I disable all panes of this Panel (in this "own" display), "View" is still output.
So, erm, that would basically mean that something else actually overrides the page title.
Comment #6
sunmeh... for my case, I was a bit confused with the Page Title module, and now found out that setting a page title without setting a title is simply not possible. So I'm overriding the title for certain content-types in my theme now.
Nevertheless... from your comment in #2:
This particular bug is true -- Panels won't use the default display title in layout settings, nor will it use the Panel Page's title.
The reason why "View" is displayed as title is quite simple: The menu item for 'node/#', resp. 'node/#/view', registers the title "View" as menu item title. Drupal automatically sets the menu item title as page title if no other title has been set via drupal_set_title().
Comment #7
nadu commentedThanks Zach Harkey for your solution. It works for me.
Comment #8
nadu commentedBut how to hide the node title in node content, because we now have two titles in page (one for page title and one for node title)
Comment #9
zach harkey commentedLocate the node content panel (be sure you have the correct sub-tab for the content type you are trying to override), and check the box that says "Override title" but leave it blank. Also, you might want to make sure to check "Node page" as well.
Attached a screenshot.
Comment #10
zach harkey commentedAlternatively you can strip the title from the page.tpl.php for all node pages, and move it to your node-type.tpl.php files.
For example, I have the following line in my page.tpl.php:
You just have to be sure to print the title in your node.tpl.php template files.
Comment #11
nadu commentedThanks Zach Harkey. It's works well for me. I think that helpful information in this post must be include in the panel documentation.
Comment #12
Shai commentedsubscribing
Comment #13
jody lynnI had the same problem after updating to beta5 and then making some changes. I tracked it down in this patch, which is the code equivalent to Zach's workaround. Apparently the layout settings title is being set now even though it's empty, which is having this awful effect.
Comment #14
smk-ka commentedThis is also true for titles set by panel arguments, which are also completely ignored.
For example, create a panel with the URL
node/%/fooand give it a default title of "Foo panel". Then add Node ID as an argument and set the page title toFoos of %node. The expected result would be the title of the argument node inserted into the page title, overriding the panel default title.This seems to be not happening because of this logic (basically the same part Lynn has been identified):
First, it seems, when viewing a panel page, the condition
$panel_page->did == $panel_page->display->didis always true (at least this was the case for me), resulting in either the display->title or the default title to be returned. Since display->title was empty, the default panel title was always returned, which is wrong.
Looking down the code in that function reveals that the default panel title is already returned at the very end of it, when all other possibilities to set a title yielded no results. This seems to be correct behavior, given the static nature of the default title.
However, if we remove the default panel title from above code, then the complete first if-clause can be nuked, and display->title returned whenever it is set (honestly I have no idea when this is the case).
Comment #15
smk-ka commentedOk, sun just stopped by and explained me the mysteries he had with display titles and multiple displays recently. Together we discussed this, and came to the conclusion that titles should actually be set in the reverse order in which they are set (look at the local tasks to understand it!). Thus, 1. context, 2. layout (called display internally), and 3. general settings.
We put together a new patch where the display title is now moved after probing available contexts, and added some comments about our findings.
Comment #16
sunI tested smk-ka's patch in #15 thoroughly now, using the following test plan:
Thus, expected behavior in a complex override setup.
Comment #17
summit commentedSubscribing, trying out above approach! greetings, Martijn
Comment #18
sdboyer commentedI'll take a look at this patch presently, and while I'm very much hoping that I can come to a similar conclusion, my history with this function doesn't have me all too hopeful. But I'll report back here once I've got something concrete.
Comment #19
merlinofchaos commentedPatch does not seem to apply.
Comment #20
smk-ka commentedRerolled.
Comment #21
merlinofchaos commentedI am trusting sun's testing here, as that's a fairly long testing plan. COmmitted, but I'd appreciate it if people would keep an eyeon this issue for awhile.
Comment #22
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #23
giorgio79 commentedHi Guys,
I am applying the same panel layout to 3 different content types.
When I set the Page Title on the Layout Settings screen, Default panel to %node it does not work.
It just brings in the site name.
When I set the Page Title on the Layout Settings screen inside each content type to %node then it does work, but I think this is still a bug, as the default setting should apply to all of them.
Any ideas?
Cheers,
G
Comment #24
giorgio79 commentedComment #25
sun@giorgio79: There are two default layout settings tabs - one is called "Node ID # Default", the other one "Default". Did you ensure that you entered %node in the first one? Also, are you working with 5.x-2.x or beta5? This issue is fixed in current 5.x-2.x development snapshot only.
Comment #26
giorgio79 commentedThanks Sun I have 5.x-2.x or beta5. I was looking for the 5.x-2.x dev snapshot but did not find a download link on the project page.
Will try to poke around svn.
Comment #27
sunI guess this is fixed then.
See http://drupal.org/node/128199 for the current development snapshot. If you can wait for RC1, you are advised to wait.
Comment #28
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #29
asak commentedIf you're still having trouble, and by any chance using more then one language, and maybe don't have a translation for these nodes your trying to display correctly - check this: http://drupal.org/node/296919 .