Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

search one keyword in different CB - fields with one statement

  • GUEST
11 years 8 months ago #221360 by
Hello together,

I created in CB 2 fields. For both fields the user can put in one value from a dropdown list (the dropdown list ist for both fields the same). Now I like search one keyword, which can be in one of the both fields. I can create the searchable fields, but the function is just looking in one. Here a example.

new CB field Car_1
new CB field Car_2

both fields can have a value from a fixed list (BMW, Mercedes, Audi, Ford, Porsche....)

Member 1 put in the field Car_1 the value BMW, in field Car_2 he put in Audi.
Member 2 put in the field Car_1 the value Audi, in field Car_2 he put in Ford.

Warning: Spoiler!


Now I like search all Users, which have the value Audi in one of the fields, no matter which. For the search the user can select a value of the same dropdown list.
So my search function need a SQL like

'....where 'Audi' is in car_1 or 'Audi' in in Car_2...'

to connect all fields for one search.


Its possible to realise this?

Thanks in advance
Andy

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
11 years 8 months ago #221363 by krileon
You want to search 2 other fields from 1 field? No, you can't do this without developing a new fieldtype plugin that has search criteria to specifically that. The alternative is to use our CB Search Bot and use Joomla search as it will search all selected fields for the value the user input.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • GUEST
11 years 8 months ago #221379 by
Hi Krileon,

thanks for the fast response. Yes, It is possible with the search bot in connection with Joomla Search, but I want specify it just to this fields to generate a userlist with the result. you know some other way, maybe a additional component or plugin wich can handle this? The search in the 2 fields is just one part, I like to combine this with some other search criterias, like range, age and some like that... Or maybe I have to go a other way to define the fields in CB? I tryed also the advanced search component, but also this can not handle the search of one keyword in different fields....

Thanks & regards
Andy

Please Log in or Create an account to join the conversation.

  • GUEST
11 years 8 months ago #221425 by
other question to this...

Is it possible to create a hidden textfield, which include the values from 2 or more other fields? On this way I can use this field for the search... Just a idea...

regards
Andy

Please Log in or Create an account to join the conversation.

  • GUEST
11 years 8 months ago #221461 by
Has somebody any idea how I can solve this?

Regards
Andy

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
11 years 8 months ago #221496 by krileon

you know some other way, maybe a additional component or plugin wich can handle this? The search in the 2 fields is just one part, I like to combine this with some other search criterias, like range, age and some like that... Or maybe I have to go a other way to define the fields in CB? I tryed also the advanced search component, but also this can not handle the search of one keyword in different fields....

You would need to create a new fieldtype plugin to handle this. It'd need to have custom search output and have proper search criteria handling.

Is it possible to create a hidden textfield, which include the values from 2 or more other fields? On this way I can use this field for the search... Just a idea...

I suppose you could using CB Auto Actions in a Code action using jQuery method to insert new inputs into the page. Could even move values to them when 1 input changes, etc.. but it's probably not going to give you the desired result as a new fieldtype would.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum