Right, I've just built a site (social publishing site for artists) with two important user roles: artist and organisation. The information my client wants from these two kinds of users is quite different, so I've created a specific content profile type for each role. Both content profile types have taxonomies too, which part overlap (artist profile has vocabularies A, B and C; organisation profile has vocabularies B and C).

Now, I had to make a User View that showed all artists and organisations on the site. I wanted to filter the View by taxonomy so I thought I could use the 'Content Profile' relationship to pull in the relevant node. But shock horror - I can only select one or the other content profile type! This was most annoying, as Views filters or arguments can only be tied to one relationship.

So I had a look at the module code in /content_profile/views/content_profile_views_handler_relationship.inc, and here I found the following code (line 23):

'#type' => 'radios',

...so I changed it to:

'#type' => 'checkboxes',

...and it worked exactly like I'd hoped - the radio buttons changed into check boxes! I just selected both of my content profile types when I defined the Content Profile relationship, and both type of nodes became available to Views as filters. Thank you Views API!

Could this change be brought into the code for Content Profile? It increases the flexibility of the module with, to my knowledge, no obvious drawbacks (perhaps slightly slower queries?). What does everyone think?

Comments

YK85’s picture

subscribing

james-intelPos’s picture

I have run in to the same problem. Does this fix have any possible problems for the future? I am not exactly sure how the relationship is being assigned?

Will Views look for node type 'content profile' and field 'title'? This will cause the first title to be over written by the second will it not? I currently have no duplicate field types from either of my two 'content profile's but just want to make sure that future changes will not be affected.

Thanks