on registration i want to present a pulldown to the new user where he can select his agent / contact person. This agent however is also registered on our website and is assigned to the usergroup agents.
Is it possible to create a pulldown with all the users who are member of the usergroup agents?
Yes, using CB Query Field you can create a Query Select fieldtype that pulls its select values from a database query. Your database query could be something like the below to pull a list of users.
Query:
Code:
SELECT u.`id`, u.`username`
FROM `#__users` AS u
INNER JOIN `#__user_usergroup_map` AS m
ON m.`user_id` = u.`id`
WHERE m.`group_id` = GROUP_ID_HERE
Value Column: id
Label Column: username
With the above you'd replace GROUP_ID_HERE with the actual id of the user group id.
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.