Hello ~ I am currently working on a website (using Drupal 6) that requires some advanced functionality using exposed filters on a custom CCK content type. The new CCK content type has 6 attributes with associated values. I'm using Views2 exposed filters to create a search of the content type:, e.g. if attribute1 AND attribute2 AND ... attribute6 of the content type match, show the results. This works quite well for showing results matching the entire query.
My question ~ I am interested in also showing results partially matching the query as well ~ kind of like a range, i.e. show all results matching 100% of the query first (what the above does), but also 83% of the query (5/6), 67% (4/6), and 50% (3/6). I've tried using Views OR but I think I need to delve into some module development.
I'm wondering if anyone has a good starting point, or any advice as I'm pretty confused looking at the drupal back-end ~ hooks and things? Thanks! (Also, I hope I'm posting in the right forum!?!)
Comments
Create multiple instances of views using Add display option
Hi,
You are on right path. Use views or module. But create multiple instances of views and override filters in each instance.
Let say your default instance of view is just showing 100 %.
In your second instance override filters and add views or between only first and second attribute of cck. This makes 5/6
Create one more views instance now add views or filter between first and second, second and third this makes 4/6.
Continue like this and enable all the blocks in your results page. Read views or module readme.txt to find how to add or between elements in filters.
After creating enable all the instances with different title in your results page.
Hope you got the answer.
Cheers,
Anil Sagar,
Lead Drupal Developer,
Azri Soulutions,
http://azrisolutions.com/
Thanks!
Thanks Anil ~ I'm beginning to see the logic! ~ very ingenious! I'll be trying this over the next few days and I'll post my progress. Again, thanks!!
`T
One (more) quick question
Hi Anil ~ One more question ~ By instance do you mean within 1 view, I make multiple block instances or do I make multiple views, overriding the exposed filters?
Hi
Hi,
I mean within one view make multiple block instances and override the exposed filters for different blocks.
Cheers,
Anil Sagar,
Lead Drupal Developer,
Azri Soulutions,
http://azrisolutions.com/
Hi again
Hi Anil ~ Thanks so much ~ I figured it out after I tried and forgot to respond back. One last question, by "enable the blocks to the results page", do I simply enable the blocks under blocks and limit them to the results page ~ is this what you mean?
Thank you so much, you've been so much help and your solution for my problem is really ingenious ~ Thank you!
`T
Got it working!
Hi Anil ~ Sorry for all the messages, and confusion. I think I got it working ~ Thanks so much (I love Drupal and FLOSS ~ what a bunch of great communities with awesome people!)
Take care
`T
Cool....
Hi Maciagt,
Great, you finally figured it out. Happy drupaling :-)
Cheers,
Anil Sagar,
Lead Drupal Developer,
Azri Soulutions,
http://azrisolutions.com/