In the panels_content_node_content() panels decides to remove the node title before its put in the $block->content
well i can se the reason for this but it creates a bit of a problem for themers/designers whos not always place the title at the top of an block. So if i uses a template file for the block we cant work with the title inside the node :/ (or am i missing something)

my quick trick is just commenting the unset($node->title) @line 60 in node_content.inc, but thats not the proper way ... ;)

or should i instead create a new content type for these kind of nodes?

Comments

merlinofchaos’s picture

Category: support » bug

The title is removed because theme_panels_pane wants control over the title, but theme('node') also wants control over the title.

Interestingly, I *thought* I had put an option in to not remove the node title here, but apparently I hallucinated that. I had intended to do that. As such, this is a bug.

sun’s picture

Title: why remove the title from node_content » $node->title removed from node_content
Version: 5.x-2.0-beta2 » 5.x-2.0-beta4b
Status: Active » Needs review
StatusFileSize
new1.17 KB

So attached patch adds a setting to use the node title as page title.
However, while $node->title is finally available in node.tpl.php, the page title isn't set, nor altered due to the existence of $node->title.

sun’s picture

StatusFileSize
new983 bytes

After testing some more, we can simply remove that unset(). AFAICS, it doesn't affect Panels' output at all, and finally allows to use $node->title, resp. $title, in node.tpl.php.

Attached patch fixes this, and also cleans up code for $block->title_link.

sun’s picture

Status: Needs review » Reviewed & tested by the community

I just accidentally nuked my working-copy of Panels, upgraded to current development snapshot, applied the last patch, and node titles started to working again.

niklp’s picture

Is this working now for node titles AND page titles...? so page_title module etc will still work as normal?

sun’s picture

Yes, Page Title module works with this patch, too. Just tested it.

merlinofchaos’s picture

I don't get it. Won't this end up causing the title to be output twice?

sun’s picture

The node title would be only output twice if a) there's no pane title override and b) you've configured the pane in a way that node.tpl.php will output the node's title (f.e. teaser view). However, that's up the user/theme developer who configures Panels. Without this patch, the node's title cannot be output in node.tpl.php at all.

sun’s picture

Version: 5.x-2.0-beta4b » 5.x-2.0-beta5

Still required in beta5.

fairwind@drupal.ru’s picture

I'm apply this patch and page_title still not work (because i use v.2.0 of page_title?)

upd. sorry, my fault: just need to modify template.php :)))

sun’s picture

@fairwind: This issue is about node titles, not page titles. You might have a look at the list of related links in #270699: Reverse page title override logic.

merlinofchaos’s picture

Status: Reviewed & tested by the community » Needs work

The node title would be only output twice if a) there's no pane title override and b) you've configured the pane in a way that node.tpl.php will output the node's title (f.e. teaser view).

This is NOT an uncommon situation.

This trades one bug for another, and that other bug will be reported ten times as often as this one. I need a solution better than that.

niklp’s picture

I'm fresh out of ideas, but I can tell you that not having the $node->title available in the template file nearly made me cry.

sun’s picture

Assigned: Unassigned » sun
Status: Needs work » Needs review
StatusFileSize
new1.73 KB

Due to Earl's complaints in #12, attached patch turns the node title into a pane configuration option.

However, although I've added this to checkbox description text, I never saw the node title twice or as page title.

merlinofchaos’s picture

This should be made to match the version that is already set up with a checkbox in panels node legacy (which I'd totally forgotten existed until I was porting that to D6)

sun’s picture

StatusFileSize
new1.99 KB

erm... panels_node_legacy looks quite different in a visual diff - so I don't really get your point here. Do you only mean the form item's description text? I would not agree with that, because the description (as well as the internal configuration key name of leave_node_title) is negated, which makes it harder to understand (for users as well as developers).

Forgot to initialize node_title in the $conf array, and moved that option below the title override setting.

dwightaspinwall’s picture

Did this issue ever get resolved?

I stumbled upon this thread while trying to figure out how to control the presentation of nodes displayed within Panels panes. Specifically, I've defined a simple content type called "blurb" which, apart from title and body, has one new boolean field which the user can check to either display or suppress display of the title. I see blurb playing a utility role throughout our site, allowing my marketing users to edit copy on a variety of "static" pages which have been formatted using Panels.

I was surprised to see that the node's title is not under the control of node.tpl.php. Is there a reason for this? Am I going about this wrong?

sun’s picture

Title: $node->title removed from node_content » $node->title removed from template variables

@Dwight: Without this patch, a node's title is only output in a panels pane content (= node.tpl.php) if you set the pane options to use Teaser view and to not use the page output. The node title will be displayed as pane title if you do not override the title setting.

If you want to display the node title in a page view (read: not Teaser view) and within the pane's content (read: not pane title), then you need to apply this patch and enable the new pane configuration option.

@merlinofchaos: Actually, above explanation might be the missing key for the whole issue...?

I really do not want to set my own patches to RTBC... this one is quite important.

sdboyer’s picture

Priority: Normal » Critical

I'll mark this critical so that I remember to get back to it later, sun, but at this point, I don't think I have a single minute I can take to review any other Panels issues before Szeged :(

summit’s picture

Hi,

I think I have the same issue at hand.
I am trying hard to get the title of the node showing on a node-page, but it is not working.
I tried adding this in node.tpl.php:

<div class="links"><a href="<?php print $node->url ?>"><?php print 'Bezoek direct ' . $node->title ?></a><?php print $links; ?>
</div>

But the $node->title will not show. It shows if I do not use node-override.

EDIT: I got this working with weblinks now. Nancy build a solution in weblinks.inc that worked getting the weblinks-tile to show!

Greetings,
Martijn

summit’s picture

Hi,

Any progress on this point please?
I have the same situation now on hand with another module.
Thanks for going into this!

greetings,
Martijn

sun’s picture

@Summit: If you want to see progress, then apply and TEST the patch, and report back if it works. Exactly for this purpose, this issue is marked as 'needs review'. Just complaining doesn't help anyone.

summit’s picture

Hi, Sun, didn't intent to complain. I will test the patch. Greetings, Martijn

summit’s picture

Version: 5.x-2.0-beta5 » 5.x-2.0-rc1a

Hi Sun,

I tested the patch in #16 (http://drupal.org/node/213751#comment-937452). It is working for the node-title!
The only thing is that now the node-body is not shown in the node-pane.

Because I also let node.tpl.php show the node-title it is shown twice now on top of the panels-pane.
With patch, no node-body but the title tag is working from #20.
Without patch, node-body but no title tag in #20.

Hopefully to get the node-body showing is not so difficult .
EDIT: I think the node-body is part of the $content in the node.tpl.php. I think the $content is not shown using the patch.

Again, sorry If I sounded complaining, was absolutely not intented.
Thanks for going into this again.

Greetings, Martijn

sdboyer’s picture

Assigned: sun » sdboyer

Assigning this to myself so I don't miss it next time I'm cleaning the queue.

summit’s picture

Hi Sam,
Thanks. Looking forward to a solution of the body/$content shown including this patch!

Could this problem also be the problem of my post: http://drupal.org/node/210908#comment-729857. Userreview not shown on node-pages controlled by panels 2?

greetings,
Martijn

Leeteq’s picture

Subscribing.

summit’s picture

Hi,
Any progress to this issue please Sam?

Thanks a lot in advance for looking at it again!

Greetings,
Martijn
www.trekking-world.com

laken’s picture

I was going crazy over why $title and $node->title weren't available in my node template, until I remembered I was using a panel and searching brought me here.

I applied the patch in #16 and it works perfectly for my purposes. Thanks sun!

laken’s picture

(dup comment)

summit’s picture

@Alaken, Also the node-body?

greetings,
Martijn

summit’s picture

Version: 5.x-2.0-rc1a » 6.x-3.x-dev
Status: Needs review » Active

Hi, Set this to Drupal 6. Could it be that this patch (somehow altered as a D6 patch), is still needed to get the $node->title in? Sorry if altering from D5 to D6 was not the right thing to do.
I am having an issue with cck-link now, which seems somewhat the same as with weblinks, see: http://drupal.org/node/897330

Thanks for going into this again for panels 6!
greetings, Martijn

sun’s picture

Version: 6.x-3.x-dev » 5.x-2.0-rc1a
Status: Active » Closed (won't fix)

Please don't do that. Panels for D5 and D6 are very different modules. This issue is dead.