Comments

OneTwoTait’s picture

I could use this for 6.x as well. :)

kmonty’s picture

Subscribing

mandclu’s picture

+1 for a D6 version.
(subscribing too)

kmonty’s picture

Title: Drupal 6.x » Port Taxonomy Force Al to Drupal 6.x

Changing the subject for the track page.

giorgosk’s picture

changing the .info file to

; $Id: taxonomy_forceall.info,v 1.1 2007/03/02 21:32:38 aymerick Exp $
name = "Taxonomy Force all"
description = "Force the 'all' parameter to taxonomy URLs."
dependencies[] = taxonomy
core = 6.x

; Information added by drupal.org packaging script on 2007-04-13
version = "6.x-1.x"
core = "6.x"
project = "taxonomy_forceall"

and enabling the module
I get a warning

warning: Missing argument 1 for taxonomy_forceall_menu() in C:\drupalsite\sites\all\modules\taxonomy_forceall\taxonomy_forceall.module on line 7.

but other than that the module seem to work as expected in drupal 6.6

can anybody else confirm ?
how can we get rid of the warning ?

giorgosk’s picture

Title: Port Taxonomy Force Al to Drupal 6.x » Port Taxonomy Force All to Drupal 6.x
StatusFileSize
new9.44 KB
new9.44 KB

deadwood http://drupal.org/project/deadwood
automatically converted the module into something
that was 6.x compatible - except the version in the .info file

version = "6.x-1.x"

no warnings or errors this time
but can't see the settings page
admin/settings/taxonomy_forceall

uploading resulting module

giorgosk’s picture

StatusFileSize
new9.46 KB
new9.46 KB

Changing the function taxonomy_forceall_menu()
(and clearing the cache makes the settings page appear

function taxonomy_forceall_menu() {
  $items = array();

    $items['admin/settings/taxonomy_forceall'] = array(
      'title' => t('Taxonomy ForceAll settings'),
      'description' => t('Taxonomy ForceAll settings.'),
	  'page callback'  => 'drupal_get_form',
      'page arguments' => array('taxonomy_forceall_settings'),
		'access callback'    => 'user_access',
		'access arguments'   => array('administer site configuration'),
		'type'               => MENU_NORMAL_ITEM,
    );
  
  return $items;
}

here is the updated files

I have never used CVS otherwise I would try to get an account to update the module

giorgosk’s picture

StatusFileSize
new9.53 KB
new9.53 KB

Another change was needed

function taxonomy_forceall_link_alter(&$node, &$links) {
  if (!variable_get('taxonomy_forceall_links_only', FALSE))
    return;

  foreach ($links as $module => $link) {
    if (strstr($module, 'taxonomy_term') && preg_match('/^taxonomy\/term\/\d*$/', $link['#href'])) {
      $links[$module]['#href'] = $link['#href'] .'/all';
    }
  }
}
OneTwoTait’s picture

Beautiful. Seems to work perfectly on my site so far.

babbage’s picture

+1 for official 6.x release; in the meantime I will try the port you've done GiorgosK. Nice work.

This module appears to be abandoned. aymerick, are you planning on maintaining this, or shall I nominate GiorgosK ;) to be added/take over as maintainer?

aymerick’s picture

I'm not planning to maintain this module anymore, so anyone can take it over :)

aymerick’s picture

I'm not planing to maintain this module anymore, so you can take it over if you want :)

regx’s picture

StatusFileSize
new10.88 KB

Didn't work for me in 6 but this does.

Drupal 6 reversed the order of the argsfor hook_link_alter, so not sure how the previous zip worked for anyone.
See api docs http://api.drupal.org/api/function/hook_link_alter/6

Versions
5
hook_link_alter(&$node, &$links)
6
hook_link_alter(&$links, $node)
7
hook_link_alter(array &$links, $node)

Bob Stein’s picture

This module is exactly what I was looking for. I just downloaded and tested the version posted by regx, and it seems to work flawlessly in Drupal 6.9 and does exactly what I needed it to do.

Thanks to all of you who contributed to updating this module for 6.x, and to aymerick for building the original.

joric’s picture

It doesn't work well with menus.
If you point the menu item to /taxonomy/term/[id] it won't be highlighted.
Oddly enough, if you point the menu item to /taxonomy/term/[id]/all, menu subitems won't expand! I still don't know how to fix this.

lelizondo’s picture

#13 works but this can be done with views 2, I'm attaching a view export that does what this module does.

you can play with it, it's basically the same view that views provides by default, I only changed some things like the page style and activated the option to "Show Breadcrumb". The important setting here is the "depth" option in the Taxonomy: Term ID (with depth) argument, if you set this up to 1 or more, you'll have exactly what this module does, I set it to 10 so you won't have any problem with it. You can change the view style to whatever you want, this just demonstrates the flexibility and power of views, you could even theme every taxonomy page. So cool!

$view = new view;

$view->name = 'taxonomy_term';

$view->description = 'A view to emulate Drupal core\'s handling of taxonomy/term; it also emulates Views 1\'s handling by having two possible feeds.';

$view->tag = 'default';

$view->view_php = '';

$view->base_table = 'node';

$view->is_cacheable = FALSE;

$view->api_version = 2;

$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

$handler = $view->new_display('default', 'Defaults', 'default');

$handler->override_option('fields', array(

  'title' => array(

    'label' => 'Title',

    'alter' => array(

      'alter_text' => 0,

      'text' => '',

      'make_link' => 0,

      'path' => '',

      'alt' => '',

      'prefix' => '',

      'suffix' => '',

      'help' => '',

      'trim' => 0,

      'max_length' => '',

      'word_boundary' => 1,

      'ellipsis' => 1,

      'html' => 0,

    ),

    'link_to_node' => 1,

    'exclude' => 0,

    'id' => 'title',

    'table' => 'node',

    'field' => 'title',

    'override' => array(

      'button' => 'Override',

    ),

    'relationship' => 'none',

  ),

  'name' => array(

    'label' => 'Term',

    'alter' => array(

      'alter_text' => 0,

      'text' => '',

      'make_link' => 0,

      'path' => '',

      'alt' => '',

      'prefix' => '',

      'suffix' => '',

      'help' => '',

      'trim' => 0,

      'max_length' => '',

      'word_boundary' => 1,

      'ellipsis' => 1,

      'html' => 0,

    ),

    'link_to_taxonomy' => 0,

    'exclude' => 0,

    'id' => 'name',

    'table' => 'term_data',

    'field' => 'name',

    'override' => array(

      'button' => 'Override',

    ),

    'relationship' => 'none',

  ),

));

$handler->override_option('sorts', array(

  'sticky' => array(

    'id' => 'sticky',

    'table' => 'node',

    'field' => 'sticky',

    'order' => 'DESC',

    'relationship' => 'none',

  ),

  'created' => array(

    'id' => 'created',

    'table' => 'node',

    'field' => 'created',

    'order' => 'DESC',

    'granularity' => 'second',

    'relationship' => 'none',

  ),

));

$handler->override_option('arguments', array(

  'term_node_tid_depth' => array(

    'default_action' => 'not found',

    'style_plugin' => 'default_summary',

    'style_options' => array(

      'count' => TRUE,

      'override' => FALSE,

      'items_per_page' => 25,

    ),

    'wildcard' => 'all',

    'wildcard_substitution' => 'All',

    'title' => '%1',

    'default_argument_type' => 'fixed',

    'default_argument' => '',

    'validate_type' => 'taxonomy_term',

    'validate_fail' => 'not found',

    'depth' => '10',

    'break_phrase' => 1,

    'set_breadcrumb' => 1,

    'id' => 'term_node_tid_depth',

    'table' => 'node',

    'field' => 'term_node_tid_depth',

    'relationship' => 'none',

    'default_argument_fixed' => 'all',

    'default_argument_php' => '',

    'validate_argument_node_type' => array(

      'deadwood_category' => 0,

      'deadwood_item' => 0,

      'page' => 0,

      'story' => 0,

    ),

    'validate_argument_vocabulary' => array(

      '1' => 0,

    ),

    'validate_argument_type' => 'tids',

    'validate_argument_php' => '',

    'override' => array(

      'button' => 'Override',

    ),

    'default_options_div_prefix' => '',

    'default_argument_user' => 0,

    'validate_argument_node_access' => 0,

    'validate_argument_nid_type' => 'nid',

    'user_argument_type' => '',

    'restrict_user_roles' => 0,

    'user_roles' => array(),

  ),

  'term_node_tid_depth_modifier' => array(

    'default_action' => 'ignore',

    'style_plugin' => 'default_summary',

    'style_options' => array(

      'count' => TRUE,

      'override' => FALSE,

      'items_per_page' => 25,

    ),

    'wildcard' => 'all',

    'wildcard_substitution' => 'All',

    'title' => '',

    'default_argument_type' => 'fixed',

    'default_argument' => '',

    'validate_type' => 'none',

    'validate_fail' => 'not found',

    'id' => 'term_node_tid_depth_modifier',

    'table' => 'node',

    'field' => 'term_node_tid_depth_modifier',

    'override' => array(

      'button' => 'Override',

    ),

    'relationship' => 'none',

  ),

));

$handler->override_option('filters', array(

  'status_extra' => array(

    'id' => 'status_extra',

    'table' => 'node',

    'field' => 'status_extra',

    'operator' => '=',

    'value' => '',

    'group' => 0,

    'exposed' => FALSE,

    'expose' => array(

      'operator' => FALSE,

      'label' => '',

    ),

    'relationship' => 'none',

  ),

));

$handler->override_option('access', array(

  'type' => 'none',

  'role' => array(),

  'perm' => '',

));

$handler->override_option('use_pager', '1');

$handler->override_option('style_plugin', 'table');

$handler->override_option('row_plugin', 'node');

$handler->override_option('row_options', array(

  'teaser' => TRUE,

  'links' => TRUE,

));

$handler = $view->new_display('page', 'Page', 'page');

$handler->override_option('path', 'taxonomy/term/%');

$handler->override_option('menu', array(

  'type' => 'none',

  'title' => '',

  'description' => '',

  'weight' => 0,

  'name' => 'navigation',

));

$handler->override_option('tab_options', array(

  'type' => 'none',

  'title' => '',

  'description' => '',

  'weight' => 0,

));

$handler = $view->new_display('feed', 'Core feed', 'feed');

$handler->override_option('items_per_page', 15);

$handler->override_option('style_plugin', 'rss');

$handler->override_option('style_options', array(

  'mission_description' => FALSE,

  'description' => '',

));

$handler->override_option('row_plugin', 'node_rss');

$handler->override_option('row_options', array(

  'item_length' => 'default',

));

$handler->override_option('path', 'taxonomy/term/%/%/feed');

$handler->override_option('menu', array(

  'type' => 'none',

  'title' => '',

  'description' => '',

  'weight' => 0,

  'name' => 'navigation',

));

$handler->override_option('tab_options', array(

  'type' => 'none',

  'title' => '',

  'description' => '',

  'weight' => 0,

));

$handler->override_option('displays', array(

  'page' => 'page',

  'default' => 0,

));

$handler->override_option('sitename_title', FALSE);

$handler = $view->new_display('feed', 'Views 1 feed', 'feed_1');

$handler->override_option('items_per_page', 15);

$handler->override_option('style_plugin', 'rss');

$handler->override_option('style_options', array(

  'mission_description' => FALSE,

  'description' => '',

));

$handler->override_option('row_plugin', 'node_rss');

$handler->override_option('row_options', array(

  'item_length' => 'default',

));

$handler->override_option('path', 'taxonomy/term/%/feed');

$handler->override_option('menu', array(

  'type' => 'none',

  'title' => '',

  'description' => '',

  'weight' => 0,

  'name' => 'navigation',

));

$handler->override_option('tab_options', array(

  'type' => 'none',

  'title' => '',

  'description' => '',

  'weight' => 0,

));

$handler->override_option('displays', array());

$handler->override_option('sitename_title', FALSE);

lelizondo’s picture

Status: Active » Needs review
lelizondo’s picture

@Aymerick: I just read #11 after I posted #16. Maybe it could be a good idea to post a note about the status of this module at the module frontpage with instructions on how a user can replace this module with views2.

#16 should work without problems.

Thanks

Luis

jjalocha’s picture

I just discovered this interesting module. I really need to display my hierarchical taxonomies with 'all' or infinite depth. So, this module seems to come very handy.

But I got confused over lelizondob's comment, who seems to suggest that this module is no longer necessary, because all its functionality can be implemented with Views. Since I am very new to views and taxonomies, I am unable to see this possibility. Thus, I would appreciate very much, if someone could shed more light into this issue, please.

I imagine how it is possible to use Views for displaying taxonomy searches of infinite depth. I would apply this, for example, in a menu. But I don't see, how Views could be used efficiently in a broader sense.

In my case, I have a large nested hierachy, and the users are able to select any number of terms at any depth of the tree. When a user clicks on a term in <div class="terms"> I need the higher terms to include all the lower ones. Without 'Taxonomy force all', I think, I would have to set-up path-aliases for every single term, and link them to custom views. This looks absolutely inefficient for my large controlled vocabulary, and seems impossible with user-defined terms.

Probably, I am missing something, but I don't see what.

Any insight is really appreciated.

Regards,
Jerzy

lelizondo’s picture

I understand your point, but I think you should give comment #16 a try and see if it works for you. All you have to do is import the view, it can't be easier than that.

I strongly believe views can do what this module does. using taxonomy force then it should be only an option when you don't want to use views (strange case)...

Because views can do what this module does, I doubt the maintainer of this module would want to release an official 6.x release, in this case, you'll be using only a patch with minimum support and bugs fixes.. knowing that this scenario it's possible, I think the smart way it's views..

jjalocha’s picture

I'm sorry, I couldn't test this sooner.

I've enabled the view from post #16, and it works magically! All nodes that are somehow sub-categories of the term are displayed.

Sadly, the retrieved nodes are displayed very strangely. I suppose, at least part of this can be customized in the view, but I still understand how it works, so I'll try to figure out how to fix this:

I have 'multiple terms' activated in taxonomy. So, every node gets listed several times. One time, for each taxonomy term. But not only for taxonomy terms that are sub-terms of the search term, but simply for every single term on the node! This is not a good output, because the user gets swamped with duplicate information.

Still, I am very impressed with the 'views' solution, and will keep tweaking it.

lelizondo’s picture

somewhere in the argument or the filters find something like "prevent duplicates", I don't remember exactly where is it.. that will solve the problem you're describing.

the views solution it's far more powerful than taxonomy force, since you can easily theme the view, show it in a table, show only certain fields, apply some other filters, etc..

jjalocha’s picture

StatusFileSize
new98.16 KB
new86.25 KB

I found the Reduce duplicates option in 'Defaults: Configure Argument Taxonomy: Term ID:
http://drupal.org/files/tid_0.png

But it is not available for Taxonomy: Term ID (with depth):
http://drupal.org/files/tid_0.png
That's frustrating!

BTW: Does anyone know how to embed images in the furum posts?

mrfelton’s picture

+1 for Drupal 6 port...
how about creating a Drupal 6 branch now that there is a semi working port?

Virr’s picture

lelizondob, big thanx!

lelizondo’s picture

I just wanna say that you can also take a look at the TVI: Taxonomy Views Integrator which extends the possibilities to override every vocabulary/term page with it's own view.

I really don't see the need for a 6.x of Taxonomy Force All anymore.

@deeporange1 did an amazing job with TVI

gunwitch’s picture

Subscribing.

Rameez’s picture

Can u please say me how to do this with TVi?

webtig’s picture

TVI README.txt

The nitty-gritty:

1: TVI cannot currently deal with multiple term displays.
ex. taxonomy/term/4+6+7 and will pass these requests to non-TVI views if
they exist, or taxonomy if all else fails.

lelizondo’s picture

@Raiz TVI is very well documented. Is not really hard to use.

fengtan’s picture

#13 works well for me. thank you.

pomliane’s picture

Status: Needs review » Closed (won't fix)

This version of Taxonomy Force All is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.