Use case description
The initial use case that inspired this tutorial was the handling of an elections process on a political website that is built using Joomla and Community Builder. All party members are Joomla users with Community Builder profiles.
The elections process calls for potential candidates to apply for one or more specific ballots. The application approval is handles offline, since it involves checking various party constitutional prerequisites (age, good standing, etc.).
Once a candidate is approved for a specific ballot, the candidate's name needs to be added to the specific ballot candidate list.
You can of course map this use case from a political party concept to any club elections concept.
Solution overview
Our solution approach is to create a new Community Builder tab called 'Elections'.
We then create a number of Community Builder checkbox fields (one checkbox field for each ballot) in our Elections tab.
These ballot fields are readonly and can only be modified by Joomla administration area users accessing user profiles from the CB User Manager area.
Moving forward we create a number of CB User lists (one for each ballot) and configure these lists to automatically show all CB users that have the relevant CB ballot checkbox field checked.
The overall process is then handled as follows:
- Potential candidate applies for one or more ballots (offline process)
- Party officials receive and process application (offline process)
- Accepted applications will result in candidate CB user profile updated to check relevant ballot fields in Elections tab
- Candidate name is automatically included in the CB User list for the ballot candidate list.
Implementation
Initial step is to cerate a new CB 'Elections' tab.
In our use case implementation we have chosen to make this tab public as we have no need to hide our ballot fields in frontend profiles.
We could also use the Joomla 2.5/3.0 ACL functionality to set that this tab is only viewable for specific access levels.
Our Elections tab setup is shown in the following screenshot:
We then create 3 CB checkbox fields (our use case calls for 3 ballots) as illistrated in the following screenshot:
Each cb_ballot field is configured to not appear during registration and to be readonly as illustrate in the screenshot:
We also create 3 CB User lists (one for each ballot) that sort users in ascending lastname/firstname fields and filter users based on the relevant CB ballot field.
This is illustrated in the CB user list screenshot that follows:
This completes the configuration of our use case.
Results
An authorized Joomla administrator area user can use the CB User Manager to find a party member profile and update the ballot checkbox fields in the elections tab as illustrated in the following screenshot:
If all three checkboxes are clicked for a candidate then that CB user will appear in each CB user candidate list. One such list is illustrated in the following screenshot:
Summary
This use case has shown you how to use Community Builder functionality to handle a specific election candidacy process. Many concepts discussed here can be used to fullfil other use cases. Hopefully this tutorial has inspired you and will help you with your use case variations.