Skip to Content Skip to Menu

🕒 Save Time and Effort with CB Editor Assistant: Effortlessly create and refine content in Joomla 3, 4, & 5.
🎁 Limited Offer: Enjoy a 5-day FREE trial and save up to 30% afterward!

Users list managment questions

  • ktm640
  • ktm640
  • OFFLINE
  • Posts: 44
  • Thanks: 3
  • Karma: 0
7 years 10 months ago #292154 by ktm640
Users list managment questions was created by ktm640
1. I create field - Drop Down (Multi-select) "cb_interests" with 1,2,3,4,5,6,7,8 values.

Users list filters by this field.

I don't understand what Operator I need to use to show all users in the list (trying different but without success).

I use Operator - "is one of (,-separated values)" 1,2,3,4,5,6,7,8

But problem if user selected two or more values in "cb_interests" field, in search by only one of this values user not show.

Example: user select in "cb_interests" value 2 (Masage master) and value 5 (Haircut master)

In search I selected show all Masage masters, but users who have more than one selected profession not show.

How solve this?

2. In Sorting tab I sort users by "cb_featured" field. But there is only two options "Descending" and "Ascending".
How I can sort users also by the positions?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
7 years 10 months ago #292177 by krileon
Replied by krileon on topic Users list managment questions

I use Operator - "is one of (,-separated values)" 1,2,3,4,5,6,7,8

That operator is stating the following.

FIELD_VALUE is one of the following COMMA_SEPARATED_VALUES

This means if the field value is "Test" and you have "Test,Pass,123" it'll pass because "Test" is one of the values to match.

But problem if user selected two or more values in "cb_interests" field, in search by only one of this values user not show.

That's due to the way multiselect fieldtypes store their values. They're stored as VALUE_1|*|VALUE_2|*|VALUE_3 etc.. So when you do an equal to operator like "is one of" it's comparing "VALUE_1|*|VALUE_2" is one of "1,2,3" and is always going to fail. You've 3 options basically. You can use the "Contains" or "Does not nontain" operators and match against a single value (e.g. FIELD Contains 1) or use the "Is REGEXP" or "Is Not REGEXP" operators and supply the the appropriate SQL safe REGEXP to match your values. The final option is set it to Advanced and supply your own SQL.

2. In Sorting tab I sort users by "cb_featured" field. But there is only two options "Descending" and "Ascending".
How I can sort users also by the positions?

It simply adds that field column to the Order By statement of the query, which it can only do so in Ascending or Descending order. If you need an advanced usage you need to set it to Advanced and supply your own Order By SQL.


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