Developer forum

Forum » CMS - Standard features » User selectable groups

User selectable groups

Ivan Blažun
Reply

Hi there!

By default (TurnKey), does DW offers User selectable groups on Swift solution, because on Create account page that is Extranet app, there is option to add "User selectable groups"? 

What I mean is, can user while on registration form choose  group of  users   in which he belong after registration.

For example B2B or B2C group.

 

Tnx!

 


Replies

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

Yes, select your group here

This is dynamicweb feature 

 
Wiktor Wieczorek
Reply

I'm trying to do something similar using the Extranet app - Create user:

If I add the groups in the "Groups for new users" like Shiwanka said, it adds the user to all of the groups by default and the user can't select which group he wants to be added to, which is what me and I believe Ivan as well wanted to achieve.
I tried to find information on how to use the "User selectable groups", but I haven't found any solution to the issue, I would appreciate any advice, thanks :)

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

"Groups for new users" will be forced on the user. "User selectable groups" are meant to be selectable.

Loop them using 

GetLoop("SelectableGroups")

For each element in that loop, render the checkbox - checkboxes should be named UserManagement_Form_SelectableGroup_{groupId} where {groupId} is the id of the selectable group.

I.e. something like this:

@GetString("UserManagement:User.SelectableGroup.Input")
<label for="@GetString("UserManagement:User.SelectableGroup.InputName")">@GetString("UserManagement:User.SelectableGroup.Name")</label>
Votes for this answer: 1
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I am trying to add a functionality in the Manage Users functionality in Swift where the Company Admin User (that can create additional users) would create users in a company-specific group.

I have tried using the above rule by using a hidden checkbox with this code:

<input type="checkbox" id="UserManagement_Form_SelectableGroup_136" name="UserManagement_Form_SelectableGroup_136" value="True" />

In this case, 136 is the ID of the group.

No matter how I have set up the solution, I cannot add the user to another group than the one(s) mentioned in the "Groups for new users".

I have tested initially in a standard Swift where I have made visible the selectable groups checkboxes. The version I am testing with is 9.15.2.

Here is how my settings look like:

Thank you,

Adrian

 

You must be logged in to post in the forum