repro:

1. create a menu item in Navigation menu with title "Menu Test1" and URL alias "panel/test1"
2. create a panel with 2 col, panel title "Panel Test1" and URL alias "panel/test1"
3. add some content to the 2 cols, save
4. open the url "panel/test1"
5. title of the panel is now "Menu Test1", but should be "Panel Test1"

how can i fix this bug?

Comments

merlinofchaos’s picture

This is a limitation of the Drupal menu system.

You MIGHT be able to fix this by adding a Custom content area to the panel, set to the PHP filter with the following code:

drupal_set_title('...what i want the title to be...');

Panels is missing the feature to add menu items in a similar manner to Views. It's something I've meant to get to, but I've had so little time to work on stuff that it just hasn't happened.

marc.bau’s picture

if this is not possible, why haveing a title field for a panel :-) ? sorry i'm new to drupal, but i realy hope you find a way to overwrite this... i checked out a different menu item, where i'm not using panel. The Menu item is named "Test1 Item" and the content have a "Test1 Content Title" title... this is working well!?

this bug realy breakes a good and required feature... my menu item should be a short name and the panel title should be more detailed...

merlinofchaos’s picture

Category: bug » feature
Status: Active » Closed (duplicate)

In Drupal, if you have a URL, say foo/bar, and you add a menu item and set a title, that title is *supposed* to override the default title supplied by the code. That is the way the Drupal menu system is intended to work.

This is not a bug, this is simply a behavior that you're not expecting, and it's a Drupal issue, not a Panels issue.

That said, the code I posted could be a workaround to this behavior.

And the feature request part of this is actually a dup of http://drupal.org/node/81132

marc.bau’s picture

i checked this another time and sorry, but there must be something wrong with your last statement.

1. create a menu item with title "Test Item" and URL alias "test"
2. create node content. title "This is a Test Item" and URL alias "test"
3. klick the "Test Item" in the Navigation
4. The node is displayed and the Title on the Node is "This is a Test Item"

this is correct... as it should be.

merlinofchaos’s picture

That's because nodes do a drupal_set_title() to change the title so they're not inheriting it from the menu system the way panels does.

Try it with something more pedestrian and less dynamic than a node, such as an admin page or the like.

Either way, if you don't believe me, tough. I'm done with this issue.

marc.bau’s picture

Sorry, this has nothing to do with - believe or not. I don't understand your position. some postings ago you said - i can try myself, now you say - this is caused while the node do a set drupal_set_title(). so - panels save the custom title in DB, why does panel not set drupal_set_title() automaticaly? this is what i simply expect...

Additional i don't understand where i should put the drupal_set_title() call in the panel source. do you have a line for me?

kcolwell’s picture

The title could also be replaced at the template level... assuming that you don't have hundreds of panels.

			if ($title == "Alumni")
				{
					print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. 'Office of Alumni Affairs' .'</h2>'; 
				}
			else
				{
					print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; 
				}