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

TicketForm

Frontend form to create and edit tickets. Logged-in users only.

Call uncached: [[!TicketForm]].

Edit mode: &tid= or ?tid= in the URL. Delete/restore uses Tickets::deleteTicket() with &redirectDeleted / &redirectUnDeleted.

Parameters

NameDefaultDescription
&allowedFieldsparent,pagetitle,contentEditable fields; TVs allowed
&requiredFieldsparent,pagetitle,contentRequired fields
&bypassFieldsFields saved without sanitization
&parentsSection parent IDs, comma-separated; -id excludes
&resourcesSection IDs; -id excludes
&contextContexts to search sections
&sortbypagetitleSection list sort field
&sortdirASCSection list sort direction
&tidTicket ID for edit mode
&redirectUnpublished0Resource ID after saving unpublished ticket
&redirectDeleted0Redirect after delete
&redirectUnDeleted0Redirect after restore
&allowDeleteShow delete button in update form
&allowFiles1File uploads on tickets
&source0Media source; else tickets_source_default
&tplFormCreatetpl.Tickets.form.createCreate chunk
&tplFormUpdatetpl.Tickets.form.updateUpdate chunk
&tplPreviewtpl.Tickets.form.previewPreview chunk
&tplSectionRow@INLINE <option...><option> row in section list
&tplTicketEmailBcctpl.Tickets.ticket.email.bccBCC on new ticket
&tplTicketEmailSubscriptiontpl.Tickets.ticket.email.subscriptionEmail to section subscriber
&tplFilestpl.Tickets.form.filesFiles block
&tplFiletpl.Tickets.form.fileFile row
&tplImagetpl.Tickets.form.imageImage row
&validateFormIt rules; see TicketFormit
&customValidatorsFormIt validator snippet names, comma-separated

The section list is filtered by section_add_children on the resource. The snippet has no parameter to change that check.

Examples

Create ticket

fenom
{'!TicketForm' | snippet}
modx
[[!TicketForm]]

Edit by ID

fenom
{'!TicketForm' | snippet : ['tid' => 15]}
modx
[[!TicketForm? &tid=`15`]]