I am creating a view that will allow a logged in user to sort nodes in the view by taxonomy term. However when I expose the taxonomy term filter, I only get 'dropdown' or 'autocomplete' as an option. Why is 'term reference tree' not an option for a views exposed filter? Have I missed the option or is it simply not implemented yet?

Thanks!

Comments

bartk’s picture

It's not implemented at the moment.

psf’s picture

Would also love to see this feature implemented as an alternative option to Hierarchical Select module exposed views filter (in the process of being implemented - see http://drupal.org/node/1170192 ). Integrating views exposed filters with Drupal taxonomy hierarchy in a general sense is an incredibly powerful feature. It would allow users to filter content on sites with complex taxonomy term depth in addition to narrowing down content by being able to filter across multiple site vocabularies i.e. -

Filter by
Vocabulary #1 - Parent >> Child >> Grandchild.
and
Vocabulary #2 - Parent >> Child

[Show Result of Filter]

This module would provide an intuitive, visual tree-like representation as a filter for a specific vocabulary(s) for the user if integrated with views exposed filters.

oskarg’s picture

Are there any plans on implementing this feature in the near future? It would be awesome!

johnv’s picture

Should this not be the other way around? Widgets all follow the same API. Can Views use any widget as an exposed filter?

larjohn’s picture

Any news about this issue???

bartk’s picture

Realistically I don't have the time to implement this in the near future, but if someone else would like to, I'd be happy to add them as a co-maintainer.

Bart

bartk’s picture

Status: Active » Postponed
technikh’s picture

+1

jeremymears’s picture

Would like this also.

How would this be implemented anyway? How much work would be involved? Would be willing to give it a go if given some idea of what is involved

larjohn’s picture

I have really no idea about Views filters, but having used this module in a very large taxonomy (3 levels - 6192 terms), you should have in mind AJAX lazy loading, as it gets really slow otherwise

alanom’s picture

Check out the code of the Better Exposed Filters module. That implements this exact feature in everything except for the javascript, and it works great in D7.

Two options for making the two work smoothly together:

  • Have an option, or, hook into Better Exposed Filters options, to use the Term Reference Filter javascript if both modules exist, (Pro: not much work needed, no code duplication. Con: requires a little co-ordination, people who want two features with the same UI need to install two modules)
  • 'Borrow' their code for the Views side of things, apply existing Term Reference Filter javascript (Pro: easy, no additional dependencies. Con: duplicating code is bad)

The first option seems like a good one.

Anonymous’s picture

And what about this one?
http://drupal.org/project/term_reference_tree

It would be SUPER if it just worked out of the box with views...

ionmedia’s picture

any news?

areikiera’s picture

Definitely agree that this would be an awesome feature!

rootical’s picture

I wrote similar logics in jQuery which you could apply to a bef checkboxes filter. Does anyone needs it?

areikiera’s picture

*hand raised*

That would be great, rootical! Thanks!

rootical’s picture

The plugin:

(function($) {
	$.fn.collapsibleMenu = function() {
		var el;
		el = $(this)
		var plus;
		plus = $('<a href="#">+</a>').addClass('plus');
		el.has('ul').addClass('has-child');
		plus.prependTo('.has-child');
		$('.has-child ul').hide();
		
		$('.has-child .plus').bind('click', function(e) {
		  e.preventDefault();
		  var it;
		  it = $(this);
		  it.parent().toggleClass('expanded-item');
		  $('ul:first', this.parentNode).toggle('slow');
		  return it.html((it.html() === '-' ? '+' : '-'));
		});	
	};
})(jQuery);

Then call it somewhere:

  Drupal.behaviors.collapseMenu = {
    attach: function(context, settings) {
      $(".bef-tree li").collapsibleMenu();
    }
  };   
paulo.faria’s picture

I think this feature already exists:

Just add the following filter criteria to your view:
"Content: Has taxonomy terms (with depth)".

chanac_hares’s picture

But only following options are available

Selection type

  1. Dropdown
  2. AutoComplete

There is not the "term reference tree" option !

knigh7’s picture

I am also looking for this, any luck?

isimgt’s picture

any news?

tommybyskovlund’s picture

looking for the same functionality...

giuseppe.minnella’s picture

more on #17

        $(".bef-tree li input").each(function(){
                if($(this).attr('checked')){
                        $(this).parents('ul').show();
                }
        });

this will keep the menu open after performing a search.

ciss’s picture

Issue summary: View changes

In case someone wants to take a shot at this, it's actually fairly easy. We used existing instance settings to replace a taxonomy filter with term_reference_tree in a views exposed form. For details take a look at this gist: https://gist.github.com/cisso/8fe776fdf0ecd6eb539e

anybody’s picture

Version: 7.x-1.6 » 2.0.x-dev
Status: Postponed » Active

Just ran into this and indeed it would be super helpful to have the term reference tree widget available for views filters. Currently, there doesn't seem to be something like that available. Better Exposed Filters allows to switch to checkboxes, but doesn't provide the same UX as this module does.

So switchting to 2.0.x.

hockey2112’s picture

Is this feature planned for D10?

paulo.faria’s picture

You can use Facets with Search api or Core View Facets modules.

This approach has the advantage of showing only the filters that produce results.