Is there a way to modify the module (if yes, where) to have the dropdown and other form elements display all the valid values (i.e. all the values possible, all the taxonomies, etc.) instead of displaying only the ones that have nodes created for?
The reason I would need this is that I'm creating a new module which would combine a Finder query with Simplenews in order to provide a periodic newsletter based on the result of a Finder query.
But in this case the user would need to be able to create a Finder query for values which nodes might not exists yet...

Any ideas?

Many thanks!
Bence

Comments

danielb’s picture

There's no easy way, you'd have to generate your own list of options and hook in and replace them. There might be other ways like hooking into the query or view and messing with that. Check the api file or documentation page for what's available.

bbence’s picture

Thanks, that's something I can start with.
Can you tell me where the place in the code where the Finder module put handles all these select option (dropdown) stuff so I can get an idea how to create a hook which works similiar but returns all possible values?
Thanks!

danielb’s picture

Status: Active » Fixed

Well it's kind of all over the place. I guess it gets initiated by the finder_form in the form include file, but the information comes from various other functions/hooks/queries.
Your best bet is to write your own code that generates the list of options, and use hook_form_alter() or similar to make the switch.
There are also hooks in the places where finder composes it's own list so it might be more efficient to hook into those - but I don't know off the top of my head how to do that, you'd have to check the api file. The form alter way is easier though.

bbence’s picture

Thanks!
Indeed the hook_form_alter turned out to be the easier one to do, and it works more or less. :)

Another question, maybe a quick one, if you don't mind:
- I would like to save the finder form query to a serialized db table field, so the newsletter to be sent out would have the finder form settings saved.
Which array, variable, object, etc. would you save and with which hook?
And then upon retrieving the serialized object, how can I retrieve a html themed output of the result?

Thanks! :)

danielb’s picture

Probably the parameters to finder_find() are a good way of identifying a search. Probably in the same way finder_find() creates a cache entry.

But perhaps you'd just want to store the HTML results? finder_result() ? or something like that

bbence’s picture

Thanks!
What I actually would like to achive is to store the query, not the result, since I would like to retrieve the result each time a newsletter is sent out periodically, and maybe 1-2 weeks after the query is saved, the result is already different.
Again, thanks for all your kind help, I think this issue can be closed now. :)

Status: Fixed » Closed (fixed)

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

ynogales’s picture

Component: Finder Views (views.module integration) » Code
Assigned: Unassigned » ynogales

Hi, I have the same problem as Bbence... I need to modify the finder module to display all possible values of a cck.
Please, could you please, tell me how i can do it and where? any example???

Thankss...

ynogales’s picture

Status: Closed (fixed) » Active
danielb’s picture

Version: 6.x-1.8 » 7.x-2.x-dev
Issue summary: View changes
Status: Active » Closed (fixed)