Why "Display Descendants" make this url:

taxonomy/term/10 14 20 121 165 224 56 147 368 465 489 520 22

But not this:

taxonomy/term/10/all

I think this will be good, and url aliases must work with this url

Comments

indytechcook’s picture

Status: Active » Needs work

I did some testing using 'all' and received mixed results.

Using default taxonomy page callback. No views

  • Title displays correctly
  • Page content displays correctly

Using the taxonomy view

  • Content is not displayed correctly

PathAuto does not apply the correct url alias.

I did a little playing with views but couldn't get the right configuration. If this is implemented (and I think it should be) then a detailed use case is needed as part of this issue: #419798: Use case documentation .

Here is how to implement if you want to test:

Change the function taxonomy_menu_path_default starting at line 533 in taxonomy.module

From:

function taxonomy_menu_path_default($vid, $tid) {
  //if tid = 0 then we are creating the vocab menu item format will be taxonomy/term/$tid+$tid+$tid....
  if ($tid == 0) {
    //get all of the terms for the vocab
    $vtids = _taxonomy_menu_get_terms($vid);
    $end = implode(' ', $vtids);
    $path = "taxonomy/term/$end";
  }
  else {
    $path = taxonomy_term_path(taxonomy_get_term($tid));
    if (variable_get('taxonomy_menu_display_descendants_'. $vid, FALSE)) {
      //we wait to run this instead of durning the if above
      //because we only wan to run it once.
      $terms = taxonomy_get_tree($vid, $tid);
      foreach ($terms as $term) {
        $tids[] = $term->tid;
      }
      if ($tids) {
        $end = implode(' ', $tids);
        $path .= ' '. $end;
      }
    }
  }

  return $path;
}

TO

function taxonomy_menu_path_default($vid, $tid) {
  //if tid = 0 then we are creating the vocab menu item format will be taxonomy/term/$tid+$tid+$tid....
  if ($tid == 0) {
    //get all of the terms for the vocab
    $vtids = _taxonomy_menu_get_terms($vid);
    $end = implode(' ', $vtids);
    $path = "taxonomy/term/$end";
  }
  else {
    $path = taxonomy_term_path(taxonomy_get_term($tid));
    if (variable_get('taxonomy_menu_display_descendants_'. $vid, FALSE)) {
      $path .= '/all';
    }
  }

  return $path;
}
sashken2’s picture

May be it help.

In version 6.x-1.02 - "Display Descendants" works good.

indytechcook’s picture

Thanks for the suggestion sashkenn but the versions interface the the menu date completely differently. The past version controlled how the screen was displayed but this version doesn't. While this gives you ultimate control for the experienced Drupaler, the beginner is fewer options (taxonomy module or a view).

This issue is out there for a default page callback to be created. I just haven't gotten to it yet. #407490: Default Page Callback for Taxonomy Menu

indytechcook’s picture

Version: 6.x-2.3 » 6.x-2.4-beta1
Status: Needs work » Needs review

Added to 2.4-beta1. Please test.

arlinsandbulte’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me

indytechcook’s picture

Status: Reviewed & tested by the community » Fixed

Set to fixed since this is part of the latest version.

Status: Fixed » Closed (fixed)

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