Even when a page display has no menu link, the title of the menu router item itself should not be left empty but get page title as value instead.

Comments

anrikun’s picture

Status: Active » Needs review
StatusFileSize
new597 bytes

The attached patch addresses this issue.

merlinofchaos’s picture

Why? I don't agree with the assertion here.

anrikun’s picture

Because if my case I build some custom breadcrumb using menu_get_item() with path to the views page as argument. But it returns a item with an empty title if page has no menu link attached, leading to an empty link being displayed inside breadcrumb.
IMHO this is not normal (in a Drupal way): any menu router item leading to a real page has always the title of the page as title in Drupal.

Even if you don't think this is a bug, please consider this as a feature request. Adding this won't hurt. This is really a simple patch :-)

merlinofchaos’s picture

But what if the title includes tokens for argument placeholders? It will still be incorrect. This is not going to be correct behavior.

anrikun’s picture

I'm talking about using the default title of the view.
The one which description states:

This title will be displayed with the view, wherever titles are normally displayed; i.e, as the page title, block title, etc.

The aim is to assign a default title to the menu router item of the page instead of leaving it empty.

merlinofchaos’s picture

I'm just saying, if you've got a with path foo/% and there's a title set for the %, it'll still be wrong. Your solution will probably work fine without arguments, but once arguments are in place you'll get the wrong title in your breadcrumb.

anrikun’s picture

Arguments don't matter here.
The title property of a menu router item is just the default static title assigned to a page. It's a simple string that may be then overridden by a custom title callback for instance.
I think that the title of a display in Views is exactly the same: it's a default title, again a simple static string, that may then be overridden by arguments settings.
As I wrote before, this issue is just about making the title property of the menu rooter item of a page display match the title property of the page display.
It is a very small addition.

tim.plunkett’s picture

Status: Needs review » Closed (works as designed)

I disagree with the premise of this patch as well.

Furthermore, this would drastically change the behavior of Views for all existing sites.

anrikun’s picture

Title: Title of the menu router item is left empty » Use page display title as title of the menu router item instead of leaving it empty
Category: bug » feature
Status: Closed (works as designed) » Needs review

@tim.plunkett: sorry for reopening this but I need more explanations.

Furthermore, this would drastically change the behaviour of Views for all existing sites.

Have you reviewed the patch and read my explanations at #7? It is just about giving a title to a menu router item instead of leaving it empty. If you think that this could break something, Could you at least give a concrete example?

Turning this into a feature request in the meantime.

dawehner’s picture

I agree that it is unlikely that you have configured the view item as that BUT
if you did that maybe you have done this out of purpose.
If there is one thing i learned through the times is that people (mis)use drupal by 110% percent.

Are you sure it makes sense to set a title to menu-type none.

      if ($menu['type'] != 'none') {

I'm wondering for example whether the breadcrumbs should ignore it then or people should change there views configuration.
There might be an issue which allows to setup a MENU_CALLBACK or even MENU_VISIBLE_IN_BREADCRUMB.

uncommented’s picture

I know this thread has been dead for a while, but out of frustration regarding disappearing breadcrumbs, I've developed a patch to solve the issue.

There might be an issue which allows to setup a MENU_CALLBACK or even MENU_VISIBLE_IN_BREADCRUMB.

I've developed a patch to add support for a new menu setting, "Visible in breadcrumb", for pages. When chosen, this setting causes the page's listing in menu_router to include a callback to views_get_title, which I have bolted onto views.module right below views_page. This approach has the advantage of not breaking token replacement in titles.

chris matthews’s picture

Issue summary: View changes

The 6 year old patch in #11 to views_plugin_display_page.inc and views.module applied cleanly to the latest views 7.x-3.x-dev and if still applicable needs review.

Checking patch plugins/views_plugin_display_page.inc...
Hunk #1 succeeded at 167 (offset 18 lines).
Hunk #2 succeeded at 320 (offset 29 lines).
Hunk #3 succeeded at 381 (offset 31 lines).
Hunk #4 succeeded at 556 (offset 36 lines).
Hunk #5 succeeded at 603 (offset 44 lines).

Checking patch views.module...
Hunk #1 succeeded at 605 (offset 72 lines).

Applied patch plugins/views_plugin_display_page.inc cleanly.
Applied patch views.module cleanly.
warning: 2 lines add whitespace errors.