I need the flexibility for our site managers to easily to change the default "Gallery List" page title to something else. I know you can do this via the Menu system but this is not too intuitive and leads to compromises between what the link should say and what the page title should say.

My solution was to use the View Display title for the page Title and leave the menu alone. I think this fits nicely into the new V3 paradigm and allows for a more intuitive way to list galleries.

Here's the way to manually patch the alpha3 distro to get this behavior.

In node_gallery.pages.inc, find the node_gallery_list_galleries function (about line 115). Find the following code section (about line 128)

  drupal_set_breadcrumb($breadcrumbs);
  // @todo: we should be able to programmatically set some options on the view, such as number of images, imagefield_name, etc.
  $output = views_embed_view($viewkey['name'], $viewkey['display_id'], $user->uid, $content_type);

Change it to:

  drupal_set_breadcrumb($breadcrumbs);
  // Use view title in all galleries list.
  if ( empty($user) ) {
    $view = views_get_view($viewkey['name']);
    $title = $view->display[$viewkey['display_id']]->display_options['title'];
    if ( ! empty($title) ) {
      drupal_set_title($title);
    }
  }
  // @todo: we should be able to programmatically set some options on the view, such as number of images, imagefield_name, etc.
  $output = views_embed_view($viewkey['name'], $viewkey['display_id'], $user->uid, $content_type);

This will only effect the "all galleries" /galleries item and not any /galleries/%uid items.

Comments

justintime’s picture

Status: Needs review » Fixed

Nice! Committed to 3.x-dev.

Status: Fixed » Closed (fixed)

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

justintime’s picture

Status: Closed (fixed) » Needs work

I'm re-opening this. Scroogie has shown me the light. We'll discuss possible solutions before implementing anything here.

justintime’s picture

@cgmonroe - are you still subscribed to this issue? Over on #1043532: Breadcrumbs use hardcoded strings instead of menu entries we have found and fixed a large issue with breadcrumbs and the menu router, and it's got me thinking -- I'm leaning heavily towards undoing this patch.

I'm pretty sure it would be possible to detect if the menu system's title has been changed from the default. If the user has changed that, we use the menu title. If not, then we can fall back to the Views title method. While technically feasible, I'm not for sure about the UX on this - it could lead to a lot of confusion.

scroogie’s picture

It confused me a bit when I was hunting it for the translation issue over in #1193832: Gallery List defies i18n

On the other hand, I'm not sure where people would look first to change the title. With the new breadcrumb system we have a link to it that uses the menu title. Now you could say that the menu link title is not the same as the page title, and honestly, I'm not sure what would be the most user-friendly way here.

justintime’s picture

Status: Needs work » Fixed

Bah, resetting back to fixed.

After really thinking about it, in core, Page Title != Menu Title. Whether that's the way it should be or not, it's not really up to us. If we were to do anything more to this, we could:

1) Include a link from the global settings area where you change the url to /galleries that points to the active view's edit page, saying "to change the title of the page itself, go here"

2) Or, include a field that simply pushes the title from there to the view.

Personally, I don't like either, and think this should just be documented in the help.

cgmonroe’s picture

Yes, I'm still lurking about...lol

FWIW - I think everyone is in agreement that the underlying need is to be able to set Gallery List page titles, breadcrumbs, and menu links separately and as easy as possible.

I also agree that my solution doesn't fill all these needs... but it was a quick way to come close.

Looking at this larger picture discussion, I wonder if the "right" solution would be to add some fields to the Global Settings form. E.g., Title, Menu Title, and maybe breadcrumb?. Then use those for the /galleries menu settings. This would be clear to users and in a place that folks would look for such settings.

Status: Fixed » Closed (fixed)

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