View Create Edit Group Form
Use this form in a template to allow you and/or your members to Create or Edit a User Group. Members will only have access to edit User Groups where they are the Admin—just make sure to only show the Edit link to people who have access to avoid confusion.
{exp:user_groups:form}{/exp:user_groups:form}
Table of Contents
Parameters
user_group_id
Must be passed in to edit a group
name
This parameter allows you to name the form in order to control it with Javascript or style it with CSS.
form_title
class
This parameter allows you to assign a class to the form in order to control it with Javascript or style it with CSS.
return
This parameter allows you to specify the template to take users to after they submit this form.
url_title and user_group_id get converted for you to the group’s id you’re editing or creating. return=“groups/details/url_title” would take you to the details template in the groups template group with the generated URL Title for the group passed in to segment_3.
Note: If you don’t pass this in, you’re just taken to a boring confirmation message
Variables
The following are used when editing a form.
name
The name of your group
description
The description for your group
status
The status of your group - accepted values are open, or closed
type
This allows you to select the group’s membership security. If you want the group available to anyone to join, use public. If you want the group owner or site admin to moderate members, use moderated. If you don’t want anyone joining, use private. Accepted values are public, moderated, or private.
user_group_images
Create a file upload field like the example below and you can add an image to your groups.
Example
{exp:user_groups:form user_group_id="{segment_3}" return="sandbox/group/url_title"}
Name<br/>
<input type="text" name="name" value="{name}" style="width: 400px;" /><br/><br/>
Description<br/>
<textarea name="description" style="width: 400px;" rows="8">{description}</textarea><br/><br/>
Status<br/>
<select name="status">
<option value="open">Open</option>
<option value="closed">Closed</option>
</select><br/><br/>
Type<br/>
<select name="type">
<option value="public">Public</option>
<option value="moderated">Moderated</option>
<option value="private">Private</option>
</select><br/><br/>
Group Image<br/>
<input type="file" name="user_group_image" /><br/><br/>
<input type="submit" name="submit" value="Submit" /><br/>
{/exp:user_groups:form}