Hi Kevin!
Please don't hate me for this, but, I'm looking for a way to create a custom search form that is based on a users profile (created by your flexprofile). Here is an example:
A user wants to search for another user(s) that match 2 or more profile fields, such as, Skill: Sewing and State: New York. The returned result(s) would be of any user(s) who match these 2 fields.
I hope that this makes sense! I truly appreciate all of your great advise and am looking forward to your words of wisdom!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Kevin Jardine@kevin
Kevin Jardine - 0 likes
- AlphaNeon@JoeHarmon
AlphaNeon - 0 likes
- Kevin Jardine@kevin
Kevin Jardine - 0 likes
- AlphaNeon@JoeHarmon
AlphaNeon - 0 likes
- Kevin Jardine@kevin
Kevin Jardine - 0 likes
- AlphaNeon@JoeHarmon
AlphaNeon - 0 likes
- caragadatacenter@caragadatacenter
caragadatacenter - 0 likes
- Kevin Jardine@kevin
Kevin Jardine - 0 likes
- caragadatacenter@caragadatacenter
caragadatacenter - 0 likes
You must log in to post replies.Hi,
I think that you are in luck because the form plugin already does that.
Simply edit your profile form definition and take account of the names of the fields you want to search for.
Then create a search definition and enter the names of those fields.
You can specify what menus (if any) you want the search definition form to be added to, and add a search description at the top.
And that's it.
I admire your forethought to include this function into this plugin! I am able to search for all field types except for checkboxes. I have tried just one and multiple, but the return is empty. Am I doing something wrong?
I should add this to the documentation.
You cannot add check boxes to the search form because the search results are all ANDed together.
In theory it could still work even if you had:
sport=hockey & sport = baseball
because this could select everyone who had ticked both.
In practice, however, the Elgg API requires metadata searches to be put into an array keyed by the field name, and array keys must be unique in PHP.
In short, no, search doesn't work for checkbox fields.
Sorry.
Thanks for the advice!
I suppose there isn't a way for me to hard code the necessary array keys, right?
Not that I know of.
I could probably figure out a way around the current API search limitation to fully support checkbox searches but it would take a few hours to code properly and I'm afraid that I could only do that for a paying client.
I certainly understand!
Thank you again Kevin; you're the best! :)
the form plugin list search difinition why i cant set to public always private
Who gets to see this search form?
caragadatacenter, you can either wait for the next release (next week I hope) or Google for the solution as I believe I already posted a patch in this discussion group.
sir kevin could give me an idea on how to add a simple searh hook from replace profile field