When using panel-node-view template variants, you can choose where drupal get's the page-title from, including disabling the title all together. Panelizer is missing that feature. This means that the node-title can appear twice on the page, once as the page title and once in the node. If you *want* the node title to remain in the node, this could be problematic since you can no longer turn it off on the page.

Comments

merlinofchaos’s picture

Version: 7.x-2.0-rc1 » 7.x-2.0

I suppose all that's really necessary is to turn on the title control for the display, which will give the usual Title choice + selector widget.

Though when rendering we probably then need to react to this setting.

This is just a quick setting in the $form_state in the content editor. Can you give this a try and see if this suits your purpose?

jenlampton’s picture

Status: Active » Needs work
StatusFileSize
new1.79 KB

Okay, I turned the title settings back on, and tried to react to the new setting, but I couldn't really find an example of how to set the page title based on a specific pane's title. This patch works for turning off the page title, and for setting one manually (or with tokens) but there are still some TODOs in here around the from pane option.

I was thinking a good default behavior would be "From pane" with the node content pane selected... if i can figure it out :)

merlinofchaos’s picture

It looks like the panelizer task should automatically react properly since it just returns the data from render_entity() -- but instead of using drupal_set_title() you should put the title in the $info array returned from render_entity() I think.

Compare to panel_context.inc:

  $info = array(
    'content' => panels_render_display($display, $renderer),
    'no_blocks' => !empty($handler->conf['no_blocks']),
  );

  $info['title'] = $display->get_title();
jenlampton’s picture

Status: Needs work » Needs review
StatusFileSize
new1.24 KB

Ah yes, that makes more sense. This seems to be working 100%.

trogels’s picture

StatusFileSize
new1.27 KB

I got an error after applying the patch from #4 in the admin/config/content/panelizer/node/NODE_TYPE/content form

Notice: Undefined property: stdClass::$display_title in panelizer_edit_content_form() (line 393 of /var/www/prod/profiles/sclerosis/modules/contrib/panelizer/includes/common.inc)

For some unknown reason the $cache object dosen't contain property display_title. Display title appear as a property on the object display instead. The form_item to choose how to alter the title dosen't appear if the title isn't set therefore I pass an empty string.

The attached rewrite of the above patch solved my problem, though I don't believe it's the right way to go but maybe useful for others.

I'm using following versions of core and contrib:

  • drupal 7.14
  • ctools 1.0
  • panels 3.2
  • panelizer 2.0
  • panels_everywhere 1.0-alpha1
  • panels_ipe 3.2
merlinofchaos’s picture

Status: Needs review » Needs work
+++ b/includes/common.incundefined
@@ -390,7 +390,7 @@ function panelizer_edit_content_form($form, &$form_state) {
-  $form_state['display_title'] = !empty($cache->display_title);
+  $form_state['display_title'] = $cache->display_title;

In the 3.x branch, this is just set to TRUE here. I think this is the correct action.

Also in the 3.x branch, $info['title'] is actually set inside render_entity() -- I believe we should be consistent.

roam2345’s picture

StatusFileSize
new492 bytes

Here is a patch against the 3.x branch.

damienmckenna’s picture

Category: feature » bug

It sounds more like this is a bug report.

jhedstrom’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Status: Needs work » Needs review
StatusFileSize
new1.22 KB

Here's a reroll of #5 taking the feedback from #6 into account for the 2.x branch.

Patch works fine in local testing.

merlinofchaos’s picture

Status: Needs review » Fixed

Looks like I committed this a couple weeks ago and forgot to mark it fixed for both branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

user654’s picture

Issue summary: View changes

.

damienmckenna’s picture

@pinkonomy: It already is.

user654’s picture

.

damienmckenna’s picture

StatusFileSize
new20.89 KB

@pinkonomy: This are the options you get with Panelizer v3:

If you do not see those settings, perhaps Panopoly is doing something strange. I suspect you might want to start with an issue in the Panopoly issue queue, if it turns out that there is a problem with Panelizer please open a new issue. Thanks.

user654’s picture

.

damienmckenna’s picture

@pinkonomy: Please open an issue with Panolopy.

dave.erwin’s picture

pinkonomy: make sure you're using full page override.
Also make sure you go to structure > pages and enable the node template for node view, without doing that you will still see the page title.

rodrigoaguilera’s picture

@dave.erwin
With that solution if you set "No title" is also removed from the causing SEO issues.
Can be solved with this
https://www.drupal.org/node/2262173