Skip to main content
MindTouch Success Center

Boilerplate for "Request an Article" form (legacy)

This page applies to:MindTouch (current)

DEPRECATED! This page has been deprecated. Content on this page is no longer supported. Please contact Support or search our Success Center for supported solutions.

Implement a form that allows agents to request articles that are missing from the inventory of content from your documentation team. The article request is sent as an email to any endpoint you specify in the configuration. 

Create a new form

To create a basic form that will output an input element for a ticket ID (noneditable and required), product, request title (required) and description (required), follow these steps:

  1. Navigate to your site.
  2. Create a new page (in this example, we created the form in a new page called yoursitename/RequestArticle.
  3. Insert a new Dekiscript block.
  4. Copy and paste the boilerplate 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'});                     
  5. The last line in the form is the template call that accepts a button parameter where you can specify the text or markup to be displayed in a button that is generated for you.
  6. (Optional) Paste the following into a CSS block to hide any nonessential controls. 
    .modified, .tags, #related, .product-menu, .article-menu, .dw-hierarchy, .breadcrumbs, div.pageinfo, div.widget, .mt-content-container.widget,{ 
        display: none !important; 
  7. Further customize the form by adding or removing fields that suit your needs.

Form template

The most important line in the example is the form builder, which takes your form and adds the logic necessary for article request. You can change the name of the button by replacing FORMNAME.

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

What's next?

Learn how to set up your email workflow for your "Request an Article"" form. 

  • Was this article helpful?