Channel Form template tag examples
The following are examples of using User fields in a Channel Form.
We have added a parameter for user_allow_multiple="no"
(default is "yes") that toggles the field display between a multi-select and a single-select.
{exp:channel:form
channel="user_channel" {!-- update to a valid channel on your site --}
return="user_main/test_related_authors/success" {!-- Update to your template page --}
user_allow_multiple="no"
}
<div class="form-group">
<label for="single_title">Title</label>
<input type="text" name="title" id="single_title" class="form-control" placeholder="Enter title here" maxlength="100" value="{title}" />
</div>
<div class="form-group">
<label for="single_url_title">URL Title</label>
<input type="text" name="url_title" id="single_url_title" value="{url_title}" maxlength="75" />
</div>
<div class="form-group">
<label for="related_authors">Related Authors</label>
{field:user_field}
</div>
<button type="submit" class="btn btn-md btn-success">Publish</button>
{/exp:channel:form}