Skip to main content

Boilerplate for "Request an Article" form (MT4)

This page applies to:MindTouch 4

DEPRECATED! This page has been deprecated. Content on this page is no longer supported. Please search our Success Center for updated or related content.

This form allows agents to request article creation on a certain subject. This request will be sent as an email to any endpoint you specify in the configuration. To create a new request article creation form go to your site, and create a new page, for this example will will create the form in a new page yoursitename/RequestArticle

  1. Insert a new Dekiscript block
  2. Copy and paste the boiler plate below
    var args = __request.args;
    <div class="mt-support-email">
        <form class="mt-request-article-form ui-dform-form">
            <fieldset class="ui-dform-fieldset">
                <div class="mt-field">
                <label class="ui-dform-label" for="ticketid"> "Ticket ID:" </>
                    <input class="mt-email-field field" type="text" name="ticketid" maxlength="200" value=(args['ticketid'] ?? '')/>
                if(user.anonymous) { 
                    <div class="mt-field clear">
                        <label class="ui-dform-label" for="_email"> "Email:" </>
                        <span class="mt-required"> "(required)" </span>
                        <input class="mt-email-field field required" type="text" name="_email" maxlength="200" value=(args['email'] ?? '') />
                } else {
                    <input type="hidden" class="mt-email-field field" name="_email" value=( />
                    <input type="hidden" class="mt-email-field field" name="email" value=( />
                <div class="mt-field mt-last">
                    <label class="ui-dform-label" for="product"> "Product:" </>
                    <span class="mt-required"> "(required)" </span>
                    <input class="mt-email-field field required" type="text" name="product" maxlength="200" value=(args['product'] ?? '') />
                <div class="mt-field full">
                    <label class="ui-dform-label" for="subject"> "Request Title:" </>
                    <span class="mt-required"> "(required)" </span>
                    <input class="mt-email-field field required" type="text" name="subject" maxlength="300" value=(args['ticketsubject'] ?? '';) />
                <div class="mt-field full">
                    <label class="ui-dform-label" for="description"> "Description:" </>
                    <textarea class="mt-email-field field" placeholder=("Please provide context for the requested article.") name="description"></>
                template('MindTouch/Controls/WorkflowSubmitArticleRequestButton', {button: 'Submit article creation request'});                     
  3. Paste the following into a CSS block. This will hide any non essential controls. This step is optional.
    .modified, .tags, #related, .product-menu, .article-menu, .dw-hierarchy, .breadcrumbs, div.pageinfo, div.widget, .mt-content-container.widget,{ 
        display: none !important; 
  4. This will create a basic form that will output an input element for TicketID (non editable and required), Product, Request Title (required) and Description (required).
  5. The last line in the form, is the template call which accepts a button parameter where you can specify the text or mark up to be displayed in a button that is generated for you.
  6. You can customize the form even further by adding or removing  fields that suit your needs.

Form Template

The most important line in the example is, the formbuilder:

template('MindTouch/Controls/WorkflowSubmitArticleRequestButton', {button: 'FORMNAME'});

What this basically does, is take your form that you created on the page, and add the logic necessary for Article Request. You can change the name of the button by replace FORMNAME.

  • Was this article helpful?