The title of the page is the same for all weblinks/% pages.

I added the following in weblinks_init() in order to get a title that takes the term into account.

if (arg(0) == 'weblinks') {
   ...
    if( !is_null(arg(1)) && is_numeric(arg(1)) ) {
        // in a webliks/% url
        $term = taxonomy_get_term(arg(1));
        if( !is_null($term) ){
            drupal_set_title(drupal_get_title().': '.$term->name);
        }
    }
}

An option to generate a title with custom format would be nice.

By the way, I believe that in the same function:

if ($item['path'] == 'weblinks') {

should be written

if ($item['link_path'] == 'weblinks') {

Cheers,

Comments

jonathan1055’s picture

Version: 6.x-2.3 » 7.x-1.x-dev
Issue summary: View changes

This is still an issue for 7.x When browsing any weblinks group /weblinks/x or /weblinks/unpublished, /weblinks/recent or /weblinks/popular the page title in browser tab and on screen is the text set by editing the main menu. This could be improved I am sure.

The current D7 code is:

function weblinks_init() {
  global $base_path;
  // The menu title is not correct if the menu item has been moved to
  // a menu other than Navigation. See http://drupal.org/node/184955.
  if (arg(0) == 'weblinks') {
    $active_trail = menu_set_active_trail();
    foreach ($active_trail as $key => $item) {
      if (isset($item['link_path'])) {
        if ($item['link_path'] == 'weblinks') {
          $active_trail[$key]['title'] = _weblinks_get_menu_title();
        }
      }
    }
    menu_set_active_trail($active_trail);
  }
}

We could implement the suggestion from mdoubez, or something similar. I note that the 'path' to 'link_path' change has been done, but I have not confirmed which is correct.

Jonathan