Filtering by terms instead of just the vocabulary?

nath - November 25, 2008 - 16:34
Project:CCK Node Reference ASM Select
Version:5.x-1.x-dev
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

It would be really useful if one could filter the nodes not only by the vocabulary but also by the terms in that vocabulary that have been selected for the referencing node.

For example if I have two different content types: animal and overview and I have a taxonomy with the terms fish, bird and mammal.
If I now want to create an overview of fish, it would be useful if I could simply tag the overview page with the term fish and the asm field would only show me content nodes with the term fish.

I know that the overview page wouldn't have any terms at the moment of page creation but even a two step approach where I first have to select terms for the overview page and only after saving the asm field shows me the fitting nodes would be great.

#1

nath - November 27, 2008 - 13:14
Category:feature request» bug report

Ok, after looking at the code, I think that is what is intended by the code. The thing is that it simply doesn't work.

#2

nath - December 9, 2008 - 11:50
Version:5.x-1.0-rc3» 5.x-1.x-dev

Ok, how is this supposed to work?
What I think a vocabulary filter should do:
Show a termlist of the selected vocabulary when creating the node containing this widget. The terms selected define which nodes can be selected afterwards.

Is this what it is supposed to do? I don't understand the code and the widget doesn't seem to show any nodes when the vocabulary filter is activated.

#3

electricmonk - December 9, 2008 - 12:01

Ok, let's say I have a Cat node and it has a Node Reference field to nodes of type Kitten, and the Kitten node type can have terms from the Color vocabulary. I'll configure the Vocabulary Filters for Cat's field_kitten to filter by Color, and when creating / editing Cats, I'll be able to filter the Kitten list by their color.

Hope this makes things clearer. :)

#4

nath - December 9, 2008 - 12:28

Ok, that's how I understood that option. the problem is that it doesn't work. the select dropdown is always empty for me when using the vocabulary filter.

#5

nath - December 9, 2008 - 12:35

I forgot: When looking at the html source, I see all options listed. It seems they just get hidden through the JS.

#6

nath - December 10, 2008 - 10:21

After some testing yesterday:
It works on a simple test-site. So it has to be something on my site, likely some other JS that conflicts.

#7

nath - December 10, 2008 - 10:44

My first thought was that the dhtml-menu module would be the culprit. But it works when I enable that module on the test site, so the problem has to be somewhere else.

#8

nath - December 10, 2008 - 16:06

JSTools and Photoframe are innocent as well.

#9

nath - December 11, 2008 - 11:45

Perhaps it is simply because the number of nodes is so high that it breaks? At our site it tries to load 3200 nodes.

I guess, a better option would be to filter the nodes in the module before the list is send to the browser? I know that this would not allow for the on-the-fly updates that the JS offers but on the other hand page rendering time would be greatly reduced and it should also be more robust.

#10

nath - December 15, 2008 - 16:00

I'll try to implement optional filtering in PHP instead of JS. As long as it is optional, there shouldn't be any objections, I guess?

 
 

Drupal is a registered trademark of Dries Buytaert.