After spending the afternoon searching for a solution, I drop this here praying for someone's help:

My case is simple: "Imagine a complex type built on CCK with several custom fields, I'd like to provide Searching/Filtering over this type, but the "Exposing filters" of Views doesn't suit in my site, instead of that, I'm looking for a solution that let me gather nodes providing for example, nodes under a certain termId, whose price is between 100 and 1000, and fieldA is 'Value1'"

I'd like something that guides me into the strategies I followed:

- Using Exposed filters: discarded... too basic and even the example case in a populated vocabulary is not friendly
- Programming a new filter: seems to be quite complicated, other projects like Hierarchical Select are stopped at this poing.
- Using args: taxonomies could be done, but price in a range is not posible out-of-the-box, anyway a guy got it in Views 1 at http://awebfactory.com.ar/node/320, I'm working at building some kind of programmed view from the arguments but I have no solution yet
- Using views only as a "render system"??? Is there a way to do the query programatically, pass to views and let it handle it???

Besides this, the basic functionality of building a custom search block, using the third approach would be forwarding to a certain url like this:
http://host/myviewhandler/545(tid)/100(priceFrom)/1000(priceTo)/Value1 what I'm not sure if it's the correct way to do this anyway...

I'd like advise, if you had to do that "custom search over a custom node type", which path you'd follow???

I'm quite desperated yet, so I'll go for a couple of beers with the hope tomorrow I'll see clearer (or worse... I'll get a hangover :P)

Greetings
Hwangar

Comments

Hwangar’s picture

Nobody has an advise for me? Well, I'd pay a beer for an advise
Thank you in advance

merlinofchaos’s picture

Status: Active » Fixed

I'm not quite sure what kind of an answer you're hoping to get, but when you say exposed filters aren't adequate to the task, the answer is "Well then I guess you've got a lot of work to do."

I'm not sure you're aware of how much traffic this issue queue gets, but it's immense. The number of people requesting support vs the number of people who actually have time to give support is a poor ratio, so in terms of answers, I can cover the simple but for a problem as complex as yours, I'm afraid all I have to offer is some vagaries.

You can use Views more or less as a render system but you still have to let it generate the query. That might mean custom filters. You can, if you control the menu system, control exactly what is used for exposed filters, rather than displaying the actual exposed filters. These values can actually be passed in via...view::set_exposed_input(), if I remember right. This means that if the *data* aspect of the view is acceptable, then you could design your own form, massage the data and pass the proper data to the view. This is not easy nor normally recommend, but you clearly have some specific requirements.

Likewise, if you're controlling things that way, you can programmatically add or remove filters to the view prior to rendering it, allowing you to have finer control based upon the form you saw. See view::add_item() I believe. See also views_embed_view() for how to actually display a view without going through the normal mechanisms. Note that the content of the function is more important than the function yourself, because in your case you'll need to load the $view, make changes to it, and then run the execute functions, so you will need to break down the steps and execute them yourself.

I'm sorry I don't have more to offer, but compared to some others, you are doing very well to have gotten at least a bad answer in 2 days =)

Hwangar’s picture

Merlin, first of all, thank you very much
I'm going to do some "research" in your advises, and I'll comment the results I get, just in case it'd be of help for others
Anyway, after some talking in the chat, and for simplicity (I have experience with views but as a user not as a coder) I'll follow the strategy to create a custom "search block" that will compose the parameters for exposed filters, with the add-on filter "term-id with depth" published here, what for the "first version" of the site will be enough

Thank you very much
Hwangar

Hwangar’s picture

Merlin, first of all, thank you very much
I'm going to do some "research" in your advises, and I'll comment the results I get, just in case it'd be of help for others
Anyway, after some talking in the chat, and for simplicity (I have experience with views but as a user not as a coder) I'll follow the strategy to create a custom "search block" that will compose the parameters for exposed filters, with the add-on filter "term-id with depth" published here, what for the "first version" of the site will be enough

Thank you very much
Hwangar

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.