Hello People! First of all thanks for an excellent module cck + nodereference. However I need a little more functionality, just a minor one. Here is what I need:
- First there are two content types content types I'm concerned with, one is the Event (provided by the event.module) the other is Venue( created using cck). The Event content type has been extended to refer to the Venue type using the nodereference.module in cck. The purpose for this it to provide the Venues where the Events are held.
- Then comes the problem of making views that filter content based on the properties of the referenced type, in my case the Venue. The nodereference.module provides only the name of the Venue as a filter for creating custom views.
- What I need to do is add some of the attributes of the Venue type, for example its locative information and it's category types(list of taxonomy terms) as filter options for the views module using the noderefernce.module not the content type itself.
So the filter option should show in the drop down list entitled "Add Filter:" in the add view page as "Node Reference: Venue Location" or "Node Reference: Taxonomy terms of Venue type" but not like this "Location: City" or "Taxonomy: Terms of Venue type" (these are there by default anyways, there is also "Node Reference: Venue" which gives only the list of titles of all created Venues but what I want is the list of taxonomy terms of the Venue content type and the list of the Location information). So how do I do this? I believe I have to edit the code for nodereference.module and I know where I need to modify it but how? It would be really helpful if someone showed me how to expose content attribute as filter for the views.module in general.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | cck_filters.jpg | 65.31 KB | tsega |
Comments
Comment #1
moshe weitzman commentedThis capability a promised feature of Views2. It will then be up to CCK/node_ref to make use of it. Your solution is not coming for quite some time. At the highest level, you need to use hook_views_tables_alter (i might have that name off a bit) to add some new tables and a new filter in that table. your custom table will define the join needed for your query. sorry, this is complicated stuff. i haven't even done it yet, i just have an idea about process.
Comment #2
tsega commentedThanks moshe, me and my friends are working on it and I will post something if we can come up with a good solution. It's good to know that Views 2 will have this feature and I'm looking forward to it. Thanks Again. I will post back asap.
Comment #3
tsega commentedThe link below is a great help but I need to know if someone out there is able to add the non-standard node field types for the referenced node as well.
http://drupal.org/node/70380
Comment #4
jbalean commentedHi Tsega,
I've been having the same problem, where the client would like to filter an event view by a region category. I also stumbled across the http://drupal.org/node/70380, and have been modifying that. Looking at /modules/views/modules/views_taxonomy.inc gave some clues, which lead me to the following
Hopefully this is on the right track. I could not get any events displayed when I selected some terms with 'Is one of', however it definitely showed them when I selected some terms and then 'Is none of'. Possibly I have my category incorrectly set up (new to Druple) and so I decided to post anyway. Let me know if it works for you or you make any progress.
Regards,
James Balean
Comment #5
tsega commentedThanks jbalean me and my friends are trying it out but I need another help form you or from anybody who can help. I need to know how CCK provides the default filters for the views module. Meaning when ever we create a content type with CCK fields, CCK automatically provides these fields as filters for the views module. How does it do that, where can I find the code? I have attached a picture showing these fields please check it out to clarify what I mean.
Comment #6
Dzsozef49 commentedComment #7
karens commentedClosing old issues. None of us is using the D5 version any more, so hard to provide any support. Sorry.