Skip to Content Skip to Menu

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

query field in a list

  • carin
  • carin
  • OFFLINE
  • Posts: 417
  • Thanks: 18
  • Karma: 0
8 years 1 month ago #285776 by carin
query field in a list was created by carin
I made a query field with that:
Code:
SELECT #__cck_store_item_content.diler_edition FROM #__cck_store_item_content,#__comprofiler WHERE #__cck_store_item_content.id=[cb:userdata field="cb_schoolselectcck" user="#displayed" /]
But that works only on the user profile. How do I get the correct cb_schoolselectcck on a list of many users?

CB 2.0

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
8 years 1 month ago #285801 by krileon
Replied by krileon on topic query field in a list
First issue is your substitution is not surrounded in single quotes. Always treat substitutions like strings. They may not always be an integer for example. So [cb:userdata field="cb_schoolselectcck" user="#displayed" /] becomes '[cb:userdata field="cb_schoolselectcck" user="#displayed" /]'. Second issue is #displayed isn't necessary and only works on profile view. Using #displayed changes the substitution user to the one displayed, but in a field that's already always the case. So '[cb:userdata field="cb_schoolselectcck" user="#displayed" /]' becomes '[cb_schoolselectcck]' (there's no need to call userdata since you just need the raw value). That should work on profile view, userlist, etc..


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.

  • carin
  • carin
  • OFFLINE
  • Posts: 417
  • Thanks: 18
  • Karma: 0
8 years 1 month ago - 8 years 1 month ago #285829 by carin
Replied by carin on topic query field in a list
brilliant, thanks! Now the problem is that this query field does not appear on the userlist neither in Sorting nor in Filters and also I cannot have it on the search form. That was the whole reason why I created that field. How can I make that available to these places?

CB 2.0
Last edit: 8 years 1 month ago by carin.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
8 years 1 month ago #285842 by krileon
Replied by krileon on topic query field in a list
A query field can not be searched, sorted, or filtered. It is not stored in the database so neither of those are possible since the userlist searching, sorting, and filtering simply adjusts the database query. It can only be added to a column of your userlist for display.


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