I want a filter for a view that corresponds to the first level of my vocabulary. When I select Content Taxonomy fieldname for my filter, all the vocabulary in my installation come up.

Can I set depth or which subbranch?

Thanks
Chris aka My brain hurts

Comments

kulfi’s picture

I have a slightly different exposed filters issue:

I have a node type with a few content_taxonomy cck fields. I created a view to use these fields as exposed filters. The issue is that the first value/term for each field/vocabulary doesn't show in the exposed filters.

(Not sure if this is a content_taxonomy or views issues.)

socialnicheguru’s picture

It is a completely different issue. But because I hate having others waste as much time as I did to find the answer to their question, here it is: http://drupal.org/files/issues/patch_197.txt

i hope it works for you too

kulfi’s picture

Is that a Views patch that hasn't been added yet?

socialnicheguru’s picture

yes module/views/module/views_taxonomy.inc.... i think.

here is the post: http://drupal.org/node/142347

kulfi’s picture

I too am having an issue with Content Taxonomy + Views.

- Using Content Taxonomy Field as a filter: Adding the field as a filter results in every term for every category showing up in the values list.

- Using Taxonomy Terms as a filter: The view implodes/runs forever without showing any results

drupdrips’s picture

activelyOUT, ulfk, - I faced the same issue as you guys. My solution (without touching any code) was to simply create a parent Term for the original terms for the vocab in question and then select the parent term for that vocab when creating the taxonomy field for the content type. Hope it helps.

sdsheridan’s picture

@drupdrips: That solution, alas, won't work for me. I'm trying to use content taxonomy as a hierarchy of locations, for users to identify where they are, and then for others to be able to seach for users in an area. It would look pretty odd for them to have to pic "Earth" as the top term. I'd rather the display of the filter just worked properly. What I get is every first-level term of every vocabulary in the filter, and no lower terms. Any one got any ideas?

drupdrips’s picture

not sure if you actually tried what I mentioned. It will not show earth (either in fields selection or filters options). So create a vocab called "Location" (let's say). Create a Term called "Earth". Then create three sub terms under earth (like A,B,C). In your CCK Content Type configuration for the Content Taxonomy field, choose "Location" for Vocabulary, "Earth" for Terms, and 1 for - Depth of Taxonomy tree - Save Field Settings. You will see that in the CCK form you will see no mention of "Earth" for the option presented to the user - only A, B,C as checkboxes, selects or radio button options depending on your widget.

Now go to "Views" - you can add the Content Taxonomy Field for Location to Fields as well as to Filters. You will only see options under the Earth term (A, B, C) .. Earth will not show up anywhere .. it is just acting as a logical container but it helps to work around this problem.

BTW, if your content taxonomy fields (some of them maybe) are not showing up in Views (Fields or Filters listings) check this additional post I submitted since I ran into the same problem also. I know other people have encountered many other types of problems with Content_Taxonomy that I found when researching the issues queue, but these were the two that stung me and I am glad I am past these hoops.

drupdrips’s picture

one more thing .. in my case I only needed to display ONE level of terms and not multiple levels of hierarchy. I did not experiment with the Hierarchical select as I did not need it but sounds like you may need to try that if you are trying to display multiple levels in one widget.

I actually had to also create a location option for users where country is selected first and based on the selection using ajax (without submitting the whole form) a second drop down shows State/Province and then a 3rd drop down to show cities for that particular province. There are various options you could try I guess like Activeselect, Wim Leers Hierarchical select, etc. The one I happened to try that I liked the most was Moofie's solution. He has a nice write-up about this at http://blue.live4all.co.il/~mooffie/cms/node/15

The other link I was talking about in my previous post (for missing content taxonomy fields/filters in views config page) is this: http://drupal.org/node/274438#comment-963366

bsuttis’s picture

Confirming same issue, anyone made any progress?

associate’s picture

Version: 5.x-1.x-dev » 6.x-1.0-beta6

I'm needing this to. Are there plans to have hierarchy as a choice for Content Taxonomy exposed filter?

feuillet’s picture

subscribing, looking for the same thing.

Nikdhil Mdohfan’s picture

I want a filter for a view that corresponds to the first level of my vocabulary

Thomas_Zahreddin’s picture

i think this is posible:
use View 2, choose filter Taxonomy, select
Term ID (with depth)
and use 1 for the depth.