View Join Leave a Group

Allows the logged-in user to join or leave a group. Simply place this tag in a new template, and pass in the user_group_id or url_title using the URL segments (e.g. user_group_id=”{segment_3}” if user_group_id is the 3rd segment in the URL). If user is a member of the group already, a link to this template will remove them from the group. If they’re not in the group already, they will be added. If the User Group type is ‘moderate’, people that join the group will be added with a status of ‘pending’ until the admin approves them using the moderate template tag.

Note: Remember to use the {if logged_in} conditional to only display links to this template to people that are logged in (and avoid Google from hitting this template).

{exp:user_groups:membership}{/exp:user_groups:membership} 

Table of Contents


Parameters

user_group_id

url_title

return

Variables

The following are available within this tag.

user_group_id

url_title

name

description

status

type

all other fields in user_groups table

Example

{exp:user_groups:membership user_group_id="{segment_3}" return="groups/group/url_title"}{/exp:user_groups:membership} 

Category:User Groups -> Tags

Categories: