View Create Edit Topic
Use this to create or edit a new forum topic. You must pass in a user_group_id so the topic can be tied to the group. If you want to use this as an edit form, make sure to pass in a topic_id using the url segment (e.g. topic_id=”{segment_3}”).
Note: You will want to limit visibility to the edit link to people that have access using the {if is_author} conditional in the topics template tag.
{exp:user_groups:topic_form}{/exp:user_groups:topic_form}
Table of Contents
Parameters
topic_id
Optional, but must be passed in to edit
user_group_id
Optional, but either this or a user_group_url_title must be passed in to create a topic
user_group_url_title
If the group page you’re linking from uses the url_title in the url, you may wish to just pass in this instead of figuring out how to get the user_group_id passed in
name
form name
form_title
class
Class gets applied to the form
return=“template_group/template/user_group_id”
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 topic.
subject
body
status
Example
{exp:user_groups:topic_form user_group_url_title="{segment_3}" return="groups/topic/topic_id"}
Subject<br/>
<input type="text" name="subject" value="{subject}" style="width: 400px;" /><br/><br/>
Body<br/>
<textarea name="body" style="width: 400px;" rows="8">{body}</textarea><br/><br/>
<input type="submit" name="submit" value="Submit" /><br/>
{/exp:user_groups:topic_form}