Cb query issue

1 year 8 months ago - 1 year 8 months ago #330403 by crony
[SOLVED] Cb query issue was created by crony
Hello,
I've created a CB_country dropdown field and used this query
SELECT `country_name` FROM `web_comprofiler_countries`
 

I activated the plugin render
 

But, all I got is
 

I guess after that I'd make an ajax check or something like a double drop down...
Could you advise the right way please ?
I also checked this (old) tutorial, but I couldn't see some variables, but I guess it should work more or less the same ? (except I'm quering the database directly from comprofiler)
But maybe I'm wrong, this field autoselect field for countries / region is already somewhere natively in CB or CB Sub ??
www.joomlapolis.com/documentation/345-cb-query-field/tutorials/18377-configuring-a-country-field-with-cb-query-field-plugin

Thanks

J! 4.x - CB 2.7.3
Attachments:

Please Log in to join the conversation.

1 year 8 months ago #330410 by krileon
Replied by krileon on topic Cb query issue
You didn't configure the query dropdown you configured query validation. You need to create a query select fieldtype and its parameters will be under the Parameters tab (not Integrations tab).


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.

1 year 8 months ago #330413 by crony
Replied by crony on topic Cb query issue
Ah I see now, thanks !
Ok, so, I can have now the countries populated with :
SELECT `country_iso_code2`,`country_name` FROM `#__comprofiler_countries` ORDER BY  country_name
My setup is like this
 
 
 

And I'd like to connect it dynamically to the provinces from #__comprofiler_provinces
I don't understand what is the "simple" way to pass variables between multiple queries here.
Tried this, but of course it doesn't work
SELECT DISTINCT `province_name` FROM `#__comprofiler_provinces` WHERE`[cb_country]`= `[country_iso_code2]`

With this setup on this field
 
 
 

Could you help me out figuring the right way ?
Thanks a lot !

J! 4.x - CB 2.7.3
Attachments:

Please Log in to join the conversation.

1 year 8 months ago #330415 by crony
Replied by crony on topic Cb query issue
Hello,
I've been to the demo platform of CB, and I really like this demo for these 3 fields 


Is there a full proper tutorial for that ?
I think I'd like that even better for my website :)
Thanks !

J! 4.x - CB 2.7.3
Attachments:

Please Log in to join the conversation.

1 year 8 months ago #330416 by krileon
Replied by krileon on topic Cb query issue

Is there a full proper tutorial for that ?

Login to backend of our demo site and directly copy the cb_region, cb_country, and cb_state fields. cb_country and cb_state utilize the Update On feature of the CB Core Fields Ajax plugin (see Integrations > CB Core Fields Ajax > General for such parameter) to refresh their display based off previous field value change. You also don't have to use Region and can modify cb_country as needed to not include that in the query if you don't want it.

I also recommend taking a look at the address fields provided by CB Quickstart under the Details tab. They provide a more user friendly experience utilizing Query Autocomplete under Integrations > CB Query Field > Autocomplete to suggest countries to them as they type normally in a text field.


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.

1 year 8 months ago #330417 by crony
Replied by crony on topic Cb query issue
Ok, after rethinking about mobile usage and ergonomic, I'll stay with country, then region.
But I can't make it working...
The state field appears after the selection of the country, but empty...
I'm still unsure with the country_id parameter that I don't understand where it comes from...
Could you help me correcting this ?
 
 
 
 
 

J! 4.x - CB 2.7.3
Attachments:

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.249 seconds