Skip to content
  1. Extras
  2. Tickets
  3. Snippets
  4. TicketForm

TicketForm

Outputs a form for creating a ticket by the user from the frontend. The snippet must be called uncached.

Snippet call parameters

NameDefaultDescription
&allowedFieldsparent,pagetitle,content,publishedTicket fields the user is allowed to fill. You can list TV names.
&contextComma-separated list of contexts to search for sections.
&parentsBy default all available ticket sections are shown; you can limit them with a comma-separated list of parent IDs. Prefix with minus "-" to exclude a parent.
&resourcesComma-separated list of specific sections to show (or exclude with "-") in combination with &parents.
&permissionssection_add_childrenPermission checked for publishing in the section. Default: "section_add_children".
&tidUse this parameter to edit a specific ticket via the snippet without the URL parameter $_REQUEST['tid'].
&redirectUnpublished0Resource ID or URI to redirect the user to when an unpublished ticket is created.
&redirectDeleted0Resource ID or URI to redirect the user to when a ticket is deleted.
&redirectUnDeleted0Resource ID or URI to redirect the user to when a ticket is restored.
&requiredFieldsparent,pagetitle,contentTicket fields the user must fill to submit the form.
&sortbypagetitleField to sort the section list by.
&sortdirASCSort direction for the section list.
&tplFormCreatetpl.Tickets.form.createChunk for creating a new ticket.
&tplFormUpdatetpl.Tickets.form.updateChunk for editing an existing ticket.
&tplPreviewtpl.Tickets.form.previewChunk for ticket preview before publishing.
&tplSectionRow@INLINE <option value="[[+id]]" [[+selected]]>[[+pagetitle]]</option>Chunk for each section option in the form.
&tplTicketEmailBcctpl.Tickets.ticket.email.bccChunk for notifying site admins of a new ticket.
&validateForm field validation using FormIt rules (when FormIt is installed).

Call syntax

modx
[[!TicketForm]]

FormIt validator examples

You can use the validate parameter the same way as in FormIt. FormIt must be installed. Examples are described in a separate section