I ran the coder (code review) module and it showed me some changes.

There are some remaining issues:

      Line 432: new hook_theme() function is required to register theme_ functions (Drupal Docs)
      function theme_taxonomy_context_subterms($terms) {

      severity: criticalLine 40: The menu system has been completely over-hauled in 6.x. (Drupal Docs)
        if ($may_cache) {

      severity: criticalLine 41: The menu system has been completely over-hauled in 6.x. (Drupal Docs)
          $items[] = array(

      severity: criticalLine 49: The menu system has been completely over-hauled in 6.x. (Drupal Docs)
          $items[] = array(

      severity: criticalLine 56: The menu system has been completely over-hauled in 6.x. (Drupal Docs)
          $items[] = array(

      severity: normalLine 516: string concatenation should be formatted without a space separating the operators (dot .) and a quote
       $where = 'WHERE tn.tid = %d ' .

taxonomy_context.install

      severity: criticalclick to read moreLine 8: A new schema API has been added in 6.x (Drupal Docs)
        switch ($GLOBALS['db_type']) {
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pfaocle’s picture

Title: Port to drupal 6.0 » Port to drupal 6.x
Version: 5.x-1.x-dev » master
Category: bug » task
Status: Active » Needs work
pfaocle’s picture

Status: Needs work » Needs review
FileSize
9.83 KB

Slightly better patch, including all the missing stuff from reikiman's. I haven't bothered with the cosmetic/coding standards changes either, just to keep the patch easier to review for the task in the issue title!

I was just starting to test this when I realised that Drupal 6 now supports the display of taxonomy/term descriptions by default (see this issue). This was the main reason I used the module, so I'm not sure how much more time I will commit to this. Of course, Drupal core still doesn't have the /taxonomy/vocabulary/x pages or the context block provided here, so perhaps the module just needs a little rethinking.

Hope this helps someone, anway.

Imago’s picture

FileSize
14.46 KB

Thank you, it helped me. I am attaching the entire package for 6.1

lee20’s picture

Would anyone be interested in creating/maintaining a D6 branch for taxonomy context? I am currently too swamped to add support for D6 right now.

Also, a version 2.0 of Taxonomy Context will hopefully be available soon. I would like to avoid having four branches of development (e.g. 5.x-1.x, 5.x-2.x, 6.x-1.x, 6.x-2.x) as I just don't have the time to support all of them (not to mention the joys of working with multiple CVS branches). So any thoughts or suggestions on this are much appreciated!

Version 2.0 will be adding a ton of features that I have found useful. I will be posting an official announcement soon that will describe the new features.

lonehorseend’s picture

I can probably test a 6.0 version of the module out, but I'm still learning the backend of Drupal, so I'm not comfortable with doing any major programming in it. However, I must say, I really do like the module and would hate to see it be only a version 5 one. It makes working with Drupal a lot easier! I wish I had discovered this module a lot earlier in my Drupal career, it would have saved me a bunch of headaches!

lee20’s picture

Okay. I just released a dev of version 2. I think this is the version that I would like to see ported to Drupal 6, but I think it would be best to get any issues worked out with the the D-5 version before porting to D-6.

Fayna’s picture

Subscribing so I can help test.

Edit: The zipped version of Taxonomy Context in #3 actually works quite well on Drupal 6.2. I haven't received any errors or complaints so far. I was able to configure my Taxonomy block for a vocab and test it out. :-)

giorgio79’s picture

Nice let me test as well :P

wuf31’s picture

subscribe.. and reviewing..

AgentD’s picture

Subscribing.

An news on version 2 for Drupal 6?

panji’s picture

Subscribing

lonehorseend’s picture

It works in 6.6, sort of. It gives me what I want that is a list of terms on the vocabulary page and a list of child terms on parent terms. It doesn't, however, do the breadcrumbs for items not in the navigation menu, even if you tell it to do it in the content type. I think that has something to do with how breadcrumbs are handled in Drupal 6. That's what I have Menu Breadcrumb for.

kenorb’s picture

In my opinion it's working (#3).

AgentD’s picture

I'm using this on v6.6 in order to display child terms on the parent term page. Is there any way to set it to only show the child-terms which actually have a node?

Thanks,
Dan

Eugene Fidelin’s picture

Where i can download the latest version of this module for Drupal 6?

Thanks.

foripepe’s picture

subscribe

Summit’s picture

Subscribing, very interested in a D6 working version to test further.
Thanks a lot for the great work done already.

Greetings,
Martijn

wojtha’s picture

To get taxonomy_context working on node pages context, change line 301 of the patched module (#3).

Change line 301 from:

$tidscurr = taxonomy_node_get_terms(arg(1));

to

$tidscurr = taxonomy_node_get_terms(node_load(arg(1)));

First argument of this function must be an node object now in D6: http://api.drupal.org/api/function/taxonomy_node_get_terms/6

After this small fix context breadcrumbs on node pages are showing properly (if you enable it on nodetype form) and also an appropriate item in a taxonomy_context menu is activated.

wojtha’s picture

FileSize
14.56 KB

Updated ported version of the module (#3). (Just the one line changed ^^^)

radj’s picture

subscribe

Starminder’s picture

subscribe

chawl’s picture

subs

NancyDru’s picture

Is this port based on 5.x-1.x or 5.x-2.x?

wojtha’s picture

@NancyDru: 5.x-1.x probably

From first patch:

-version = "5.x-1.x-dev"
+version = "6.x-1.x-dev"
NancyDru’s picture

Status: Needs review » Postponed

I am working exclusively with V2, which seems to be the future of this module. The sooner it is fully tested by the community, the sooner it will be ported to D6.

mcreature’s picture

Thank you Nancy. I am not working with a Drupal 5 dev at the moment, but as soon as I have some more time, I will put one up and help test

ccshannon’s picture

I downloaded the module at Post #19. I am using Drupal 6.10.

I can see the admin settings at admin/settings/taxonomy_context

But there are no blocks for my vocabularies on the Blocks admin page.

I tried disabling and re-enabling the module, but Blocks do not appear on Blocks admin page.

Thanks. Let me know if you have further questions.

ccshannon’s picture

I disabled, uninstalled, then deleted the module folder for the item at #19, downloaded the item from post #3.

Reinstalled, Enabled module. Went to settings page, saved default configuration.

Went to Blocks admin. No Blocks.

No one else is seeing this issue? Again, Drupal 6.10.

Went back to the #19 module after a disable/uninstall.

No blocks show up in the Blocks page.

NancyDru’s picture

I haven't started trying to do D6 yet.

ccshannon’s picture

I did notice the thread marked as "postponed" but I was curious if anyone else who downloaded either of the above two ports had experienced the same issue. Some above comments lead me to believe people have it working in D6.x installations.

This module does exactly what I need (for D5) but I chose D6 to build my customer's online store with, and I really can't go back. Most everything I need is available for D6, though. I'd love to have this for D6. I'm working with Taxonomy Menu and am having all sorts of weird issues with it, and Taxonomy Menu of course doesn't have the contextual abilities I'd like.

In any case, thank you for taking it on, good luck with it, and I am happy to assist in any way you need. :)

EliteMonk’s picture

Title: Port to drupal 6.x: I18n » Port to drupal 6.x

for support i18n for multilanguage sites:

In function taxonomy_context_menu_tree($vid, $tid = NULL) need change

    foreach ($terms as $term) {
      $params = array('title' => $term->description ? strip_tags(node_teaser($term->description)) : t('View this section'));
      $link = l($term->name, taxonomy_term_path($term), $params);

to

    foreach ($terms as $term) {
      $params = array('title' => $term->description ? strip_tags(node_teaser($term->description)) : t('View this section'));
      $termName = $term->name;
      if (module_exists('i18ntaxonomy')) {
        $termName = tt("taxonomy:term:$term->tid:name", $term->name, NULL, TRUE);
      }
      $link = l($termName, taxonomy_term_path($term), $params);

In function theme_taxonomy_context_term($term) need change

  $output .= "  <div class=\"$type\">\n";
  if ($term->subterm) {
    $output .= '   <h2 class="title">' . l($term->name, taxonomy_term_path($term)) . "</h2>\n";
  }
  if ($term->teaser) {
    $output .= '   <div class="teaser">' . $term->teaser . "</div>\n";
  } else {
    $output .= '   <div class="description">' . $term->description . "</div>\n";
  }
  if ($term->links) {
    $output .= '   <div class="links">'. theme('links', $term->links) . "</div>\n";
  }
  $output .= "  </div>\n";

to

  $output .= "  <div class=\"$type\">\n";
  if ($term->subterm) {
    $termName = $term->name;
    if (module_exists('i18ntaxonomy')) {
      $termName = tt("taxonomy:term:$term->tid:name", $term->name, NULL, TRUE);
    }
    $output .= '   <h2 class="title">' . l($termName, taxonomy_term_path($term)) . "</h2>\n";
  }
  if ($term->teaser) {
    $termTeaser = $term->teaser;
    if (module_exists('i18ntaxonomy')) {
      $termTeaser = tt("taxonomy:term:$term->tid:description", $term->description, NULL, FALSE);
    }
    $output .= '   <div class="teaser">' . $termTeaser . "</div>\n";
  } else {
    $termDescription = $term->description;
    if (module_exists('i18ntaxonomy')) {
      $termDescription = tt("taxonomy:term:$term->tid:description", $term->description, NULL, TRUE);
    }
    $output .= '   <div class="description">' . $termDescription . "</div>\n";
  }
  if ($term->links) {
    $output .= '   <div class="links">'. theme('links', $term->links) . "</div>\n";
  }
  $output .= "  </div>\n";

In function taxonomy_context_block($op = 'list', $delta = 0, $edit = array()) need change

  case 'view':
    if (variable_get('taxonomy_context_block_display_'. $delta, 1) == 0 && $delta != $context->vid) {
      return;
    }
    $vocabulary = taxonomy_vocabulary_load($delta);
    $block['subject'] = check_plain($vocabulary->name);
    $block['content'] = taxonomy_context_menu_tree($delta, NULL, TRUE) . "\n";

to

  case 'view':
    if (variable_get('taxonomy_context_block_display_'. $delta, 1) == 0 && $delta != $context->vid) {
      return;
    }
    $vocabulary = taxonomy_vocabulary_load($delta);
    $vocabularyName = $vocabulary->name;
    if (module_exists('i18ntaxonomy')) {
      if (i18ntaxonomy_vocabulary($delta) == I18N_TAXONOMY_LOCALIZE) {
        $vocabularyName = tt("taxonomy:vocabulary:$delta:name", $vocabulary->name, NULL, TRUE);
      }
    }
    $block['subject'] = check_plain($vocabularyName);
    $block['content'] = taxonomy_context_menu_tree($delta, NULL, TRUE) . "\n";
binhcan’s picture

Title: Port to drupal 6.x » Port to drupal 6.x: I18n

Big thanks for this, EliteMonk It's working on my localhost and I am planning to update it on my server soon.

NancyDru’s picture

Note that module_exists('i18ntaxonomy') is much slower than function_exists('tt').

binhcan’s picture

Still after #32, the vocabulary page is not displaying any term/node.

asb’s picture

subscribing

Greetings, -asb

EliteMonk’s picture

In #31 added i18n support for block name

In function taxonomy_context_block($op = 'list', $delta = 0, $edit = array()) need change

  case 'view':
    if (variable_get('taxonomy_context_block_display_'. $delta, 1) == 0 && $delta != $context->vid) {
      return;
    }
    $vocabulary = taxonomy_vocabulary_load($delta);
    $block['subject'] = check_plain($vocabulary->name);
    $block['content'] = taxonomy_context_menu_tree($delta, NULL, TRUE) . "\n";

to

  case 'view':
    if (variable_get('taxonomy_context_block_display_'. $delta, 1) == 0 && $delta != $context->vid) {
      return;
    }
    $vocabulary = taxonomy_vocabulary_load($delta);
    $vocabularyName = $vocabulary->name;
    if (module_exists('i18ntaxonomy')) {
      if (i18ntaxonomy_vocabulary($delta) == I18N_TAXONOMY_LOCALIZE) {
        $vocabularyName = tt("taxonomy:vocabulary:$delta:name", $vocabulary->name, NULL, TRUE);
      }
    }
    $block['subject'] = check_plain($vocabularyName);
    $block['content'] = taxonomy_context_menu_tree($delta, NULL, TRUE) . "\n";
EliteMonk’s picture

In #31 update i18n support for subterms

In function theme_taxonomy_context_term($term) need change

  $output .= "  <div class=\"$type\">\n";
  if ($term->subterm) {
    $output .= '   <h2 class="title">' . l($term->name, taxonomy_term_path($term)) . "</h2>\n";
  }
  if ($term->teaser) {
    $output .= '   <div class="teaser">' . $term->teaser . "</div>\n";
  } else {
    $output .= '   <div class="description">' . $term->description . "</div>\n";
  }
  if ($term->links) {
    $output .= '   <div class="links">'. theme('links', $term->links) . "</div>\n";
  }
  $output .= "  </div>\n";

to

  $output .= "  <div class=\"$type\">\n";
  if ($term->subterm) {
    $termName = $term->name;
    if (module_exists('i18ntaxonomy')) {
      $termName = tt("taxonomy:term:$term->tid:name", $term->name, NULL, TRUE);
    }
    $output .= '   <h2 class="title">' . l($termName, taxonomy_term_path($term)) . "</h2>\n";
  }
  global $language;
  if ($term->teaser) {
    $termTeaser = $term->teaser;
    if (module_exists('i18ntaxonomy')) {
      if ($language->language != 'en') {
        $termTeaser = tt("taxonomy:term:$term->tid:description", $term->description, NULL, FALSE);
      }
    }
    $output .= '   <div class="teaser">' . $termTeaser . "</div>\n";
  } else {
    $termDescription = $term->description;
    if (module_exists('i18ntaxonomy')) {
      if ($language->language != 'en') {
        $termDescription = tt("taxonomy:term:$term->tid:description", $term->description, NULL, TRUE);
      }
    }
    $output .= '   <div class="description">' . $termDescription . "</div>\n";
  }
  if ($term->links) {
    $output .= '   <div class="links">'. theme('links', $term->links) . "</div>\n";
  }
  $output .= "  </div>\n";
EliteMonk’s picture

Title: Port to drupal 6.x » Port to drupal 6.x: I18n

Additional setting in setting page for this module. Allow display count nodes after term name in block.

====================

After this code:

/**
 * Display menu items expanded.
 */
 define('TAXONOMY_CONTENT_BLOCK_DISPLAY_EXPANDED', 1);

need paste this code:

/**
 * Display menu items without count nodes.
 */
define('TAXONOMY_CONTEXT_BLOCK_COUNT_NODES_FALSE', 0);

/**
 * Display menu items with count nodes.
 */
define('TAXONOMY_CONTEXT_BLOCK_COUNT_NODES_TRUE', 1);

====================

In function taxonomy_context_menu_tree($vid, $tid = NULL) need replace

      $termName = $term->name;
      if (module_exists('i18ntaxonomy')) {
        $termName = tt("taxonomy:term:$term->tid:name", $term->name, NULL, TRUE);
      }
      $link = l($termName, taxonomy_term_path($term), $params);

to

      $termName = $term->name;
      if (module_exists('i18ntaxonomy')) {
        $termName = tt("taxonomy:term:$term->tid:name", $term->name, NULL, TRUE);
      }
      if (variable_get('taxonomy_context_block_count_nodes', TAXONOMY_CONTEXT_BLOCK_COUNT_NODES_FALSE) == TAXONOMY_CONTEXT_BLOCK_COUNT_NODES_TRUE) {
        $termName .= ' (' . taxonomy_term_count_nodes($term->tid) . ')';
      }
      $link = l($termName, taxonomy_term_path($term), $params);

====================

In function taxonomy_context_admin_settings() need replace

  $form['general_settings']['taxonomy_context_block_display'] = array(
    '#type' => 'select',
    '#title' => t('Show block items'),
    '#default_value' => variable_get('taxonomy_context_block_display', TAXONOMY_CONTEXT_BLOCK_DISPLAY_COLLAPSED),
    '#options' => array(t('Collapsed'), t('Expanded')),
    '#description' => t('Do you want items on the menu expanded or collapsed by default?'),
  );
  return system_settings_form($form);

to

  $form['general_settings']['taxonomy_context_block_display'] = array(
    '#type' => 'select',
    '#title' => t('Show block items'),
    '#default_value' => variable_get('taxonomy_context_block_display', TAXONOMY_CONTEXT_BLOCK_DISPLAY_COLLAPSED),
    '#options' => array(t('Collapsed'), t('Expanded')),
    '#description' => t('Do you want items on the menu expanded or collapsed by default?'),
  );
  $form['general_settings']['taxonomy_context_block_count_nodes'] = array(
    '#type' => 'select',
    '#title' => t('Show count nodes in block items'),
    '#default_value' => variable_get('taxonomy_context_block_count_nodes', TAXONOMY_CONTEXT_BLOCK_COUNT_NODES_FALSE),
    '#options' => array(t('Disabled'), t('Enabled')),
    '#description' => t('Show count nodes in block after items. Example: term (X)'),
  );
  return system_settings_form($form);
EliteMonk’s picture

Question:

How make new project on this site expamle "Taxonomy Context 2" or update old project...

przemu’s picture

Is this port to Drupal 6 working good?

And there is a question for EliteMonk. You have made some modifications. Maybe you can pack modified files into archive and publish here?
It would be better for users looking for Drupal 6 port.

venusrising’s picture

Where can we find a Drupal 6 Port to test?

asb’s picture

> Where can we find a Drupal 6 Port to test?

Still no answer?

Greetings, -asb

NancyDru’s picture

An alpha version of 6.x is now available. It does not yet include any of the i18n stuff. It is mostly the package from #3.

@ccshannon: I do see blocks on Drupal 6.13.

NancyDru’s picture

Status: Postponed » Fixed

The i18n changes are committed to the 6.x-2.x branch and included in 6.x-2.x-alpha2.

@EliteMonk: I am English-only, so all I could so was syntax check the code. Please test it thoroughly and open new issues if you find any. BTW, I did the changes a bit differently than your code, but the effect should be the same.

asb’s picture

@NacyDru:

Thank you!

-asb

ccshannon’s picture

NancyDru, you can solve my mysteries, any day! Thanks! :D

NancyDru’s picture

There is a lot of community testing needed. I have already run into several issues in my limited use of the module. Ir would help a lot for other people who use it in different ways to check it out. As you can see I have already created a third alpha release and a -dev on top of that. As I get some of the more significant issues resolved, you can expect more alphas to come out. Please pay particular attention to the way the settings interact - I know there are some issues there. And I know that subterms are not acting right.

Status: Fixed » Closed (fixed)

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

asb’s picture

Status: Closed (fixed) » Needs work
kenorb’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

Drupal 6 is no longer officially supported. If you think this issue is still relevant for 8.x, feel free to re-open.