Postponed (maintainer needs more info)
Project:
Profile 2
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2011 at 06:36 UTC
Updated:
24 Apr 2011 at 00:03 UTC
Currently if you create a profile-type with some taxonomy fields, create a view of them with an user relationship, and want to expose them as filters, it only gives you the option of Term ID, but multiple exposed filters requires Term ID with Depth.
It's possible to do this with Drupal 6 by using content profiles, but it'd be nice if Profile2 had this functionality built in.
Comments
Comment #1
joachim commentedThis might be a change to do with Views 3.
Have you tried doing this with a view of just nodes?
Comment #2
davycw commentedYes. Nodes don't work because profiles aren't built as nodes in Drupal 7, whereas in Drupal 6 they can be built as nodes using Content Profile module (which hasn't yet been ported to D7 yet.)
Comment #3
joachim commentedYes, but what I mean is -- if you try to make a node with taxonomy fields and the same kind of setup, does it work?
What I am trying to get you to ascertain is whether this is a problem in Views or in Profile2.
Comment #4
davycw commentedOh, ok. Yeah, it works fine with nodes. It's just when you try doing an user relationship to taxonomy.
Comment #5
joachim commented> user relationship to taxonomy
How are you relating users and taxonomy?
Comment #6
davycw commentedI was using the "Profile (being the default profile-type from Profile2 module): User" relationship, and also got desperate and tried creating relationships to the fields that were appended to my profile-type, which did end up providing me with "Taxonomy Term ID: (with depth)" filters, but once I did that, no users would show up in my view.
As of right now I've gotten farther by not using the Profile2 module, creating a node-type called "profile," appending taxonomy terms to them, and using an user-relationship. It's working fine like that, but it's not as user friendly with there not being links to it on the user account page, and I haven't figured out a way to have that node creation show up on user registration.
Comment #7
joachim commentedI still don't get what you're doing.
I just added a term ref field to a profile type, and I get the filter available for my view of profiles.
What is the base of your view? How are you chaining relationships?
Did you correctly add taxonomy terms to your profiles?
Comment #8
davycw commentedSo far what I've done upon installing Profile2 is append a couple taxonomy term reference fields, say "car make" and "car model." From there I've created a view of all "Main Profiles" on my site. This provides me with a list of all main profiles on my site. At this point I'd like to start filtering these profiles, so when I go to add a filter, I'm presented with two handlers for fields in my profile-types (but no Taxonomy: Term ID or Taxonomy Term ID with depth filters) which look something like this:
This however, doesn't supply me with any options for autocomplete, select list, or any widgets like that. All it gives me is two text fields, and even when typing the correct terms into those fields, it will turn up no results.
It seems to me that a list filters for a specific profile-type should include all the taxonomy filters associated with them, Taxonomy: Term ID (with depth) in my case.
I've also tried creating various chains of relationships to unlock taxonomy filters, and did manage to chain them together in such a way as to get the right Taxonomy Term ID (with depth) filters, but it would return 4 clones of the same person's profile.
Anyway, it seems like this should be supported in Profile2, considering that in Drupal 6 the Taxonomy (with depth) filters are unlocked right from the get-go.
Edit: Also, a list of nodes can both be with Taxonomy filters, but a list of users or profile2s can't be. It makes me think there should be an option for Profile2s to be built as nodes (like Content Profile,) so they can have better views integration, but I'm not entirely sure how all these pieces of the puzzle interact. Maybe there's a way to do it without building them as nodes?
Comment #9
joachim commented> Edit: Also, a list of nodes can both be with Taxonomy filters, but a list of users or profile2s can't be. It makes me think there should be an option for Profile2s to be built as nodes (like Content Profile,)
You're on the wrong track completely with this. Let's stick to the point.
I'm on the latest dev of Drupal core, Views, Entity, and Profile2, and I have the patch from #1114454: Views integration: create an entity-entity relationship that limits by entity type if applicable and its dependency applied.
I have:
- a profile type with a taxonomy term ref field
- a user view with...
- a user -> profile relationship
In Views, I go to add the taxonomy field as a filter. In the list of filters to add, I see:
> Profile: Taxo (field_profile_taxo) - tid
That's my taxo term ref field.
I click 'Add and configure....'
I see a popup dialog that says:
> Configure extra settings for filter criterion Profile: Taxo (field_profile_taxo) - tid
I pick 'dropdown'.
(At this point, I'm really surprised it works, as last time I tried this it got stuck at this point!!)
The popup dialog then changes to let me pick vocabulary terms.
I've gone through this and added a second vocab term ref to my profile, and then added that as a second exposed filter -- all seems to work.
Can you describe how your steps differ from mine?
Comment #10
Jerome F commented@joachim: Here's how it's different from your steps in my site:
I just can select one of those, and there's no - tid:
Profile: Taxo (field_profile_taxo)
Profile: Taxo (field_profile_taxo)
The "Profile: [Taxonomy_vocabulary_name] (field_[term_reference_field_name])" filter when you use a "Term reference field" in Profile2 views exposed widget selection type is not a "Dropdown" select list widget, nor an "Autocomplete" widget, it's just a blank value field.
Or is there an other way to use "Taxonomy term: Term" filter in a Profile2 view?
EDIT: this appears to be a conflicting module, so I'm debbugging this at the moment. I have activated, disabled and uninstalled Hirerarchical Select taxonomy views for example and this was a mistake because this module is not ported to D7 yet, it's in heavy development and even the uninstallation caused errors. There's also better exposed filters I have to investigate where my issue comes from.
On a clean test site, it works ok, I have the Dropdown exposed filter select list widget.
EDIT 2: So I'm not finished testing evrything, but I suspect my issue to be related to Taxonomy translation module - In the database, in field config table the module is not "taxonomy" but "i18n_taxonomy" I have to digg in that further.
Comment #11
Jerome F commentedIt turns out the problem described in #10 might be a i18n_taxonomy issue http://drupal.org/node/1135798 - it's not related to Profile2 in any way so you can skip this.
@swornbrother: By the way do you use taxonomy translations?