[SOLVED] can i parse search results from specific field?

9 years 3 months ago - 9 years 3 months ago #256682 by technogrid
Hi guys,

i have scenario in which i need to show a list of members which have chosen specific option from one field (it's a drop down with single choice from several option) and i need to show the results in article.

i'm using the Content - Community Builder plugin so i can show the field in the article, but i want to be able to show all users which have chosen that option (ex. list of users which have chosen option 1 in the cb_location field). Any suggestion what will be the easieast way, to do it with lists perhaps?

using cb 2.0.4 on joomla 3.3

Please Log in to join the conversation.

9 years 3 months ago #256733 by krileon
You could use a CB Query Field then query for the information and output a comma separated list of usernames for example. Query example as follows.

SELECT GROUP_CONCAT( DISTINCT u.`username` )
FROM `jos_comprofiler` AS c
INNER JOIN `jos_users` AS u
ON u.`id` = c.`id`
WHERE c.`cb_location` = '[cb_location]'

You could also use the multiple row output and format the output however you like if you're not wanting comma separated.


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 to join the conversation.

9 years 3 months ago #256746 by technogrid
Replied by technogrid on topic can i parse search results from specific field?
Went the round way, i've created article for each location, and a cb list for each location, the cb list set up to show the user with the specific option in the field. Then in the joomla article i'm invoking the cb list with the joomla component include component. A bit of work since i'll have to create new list and article for each new location, but it works like a charm.

thanks for the assistance anyway

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.210 seconds

Facebook Twitter LinkedIn