Docs /Wrangler

Sample templates

Updating them later

Settings → Update sample templates replaces the templates in a group you already have with the versions shipped in the current release of Wrangler. Point it at your group and click.

It updates the stylesheet only unless you tick Also replace the page templates. That is deliberate: the stylesheet is what changes between releases and almost nobody edits it, while the page templates are exactly what you would have customised — your own markup, extra fields, a file input you added. Ticking the box overwrites all of that.

Installing and updating are separate actions on purpose. Install refuses to touch a group that already exists, so it can never overwrite your work by accident; Update only ever works on a group that does exist, and never creates one.

The one-panel layout

Every sample page puts its heading inside the same .wr-card as its content, separated by a rule, so a single box holds the whole page. The ticket page opens that panel in plain markup before {exp:wrangler:ticket} and closes it after {/exp:wrangler:reply_form}, because the two tags render independently and neither can wrap the other.

If you are building your own templates, the pieces are:

Class What it is
.wr-card The panel. One per page.
.wr-header--flush A heading inside the panel, with a rule under it.
.wr-section A block below a rule inside the panel — the reply composer, for instance.

Install them for me

Settings has an Install sample templates button. Give it a template group name and it creates all the templates below, grants every role access to them, and sets Ticket page URL to match. That is the quickest way to a working support page, and it avoids three traps that catch people doing it by hand:

  • A template with no role-access rows is invisible to guests, and EE returns a bare 404 with no hint that access is the reason.
  • The template engine field must be left empty; anything else silently fails to resolve.
  • The ticket page URL has to match the group you created, or every magic link points nowhere.

It never touches a group that already exists, so it cannot overwrite work you have customised. If something goes wrong partway it removes the group it was building rather than leaving a half-installed one behind.

Everything it creates is yours — restyle or rewrite it freely. Updating Wrangler does not overwrite templates.

Or build them yourself

These assume a template group called support, with Ticket page URL set to https://example.com/support/ticket.

The URL Wrangler builds is {base}/{reference} for members and {base}/{reference}/{token} for guests, so a guest link looks like https://example.com/support/ticket/WR-0042/a1b2c3…. The token is a path segment rather than a query parameter so it does not leak through the Referer header to third-party assets on the page.

support/index

{exp:wrangler:submit_form return="support/thanks"}
    {if error}<p class="error">{error_message}</p>{/if}

    <label>Subject <input type="text" name="subject" value="{subject}" required></label>
    <label>How can we help? <textarea name="message" required>{message}</textarea></label>

    {if needs_contact_info}
        <label>Your name <input type="text" name="name" required></label>
        <label>Your email <input type="email" name="email" required></label>
    {/if}

    {if has_queues}
        <label>What is this about?
            <select name="queue">
                <option value="">Choose one&hellip;</option>
                {queues}
                    <option value="{queue}"{if is_selected} selected{/if}>{queue}</option>
                {/queues}
            </select>
        </label>
    {/if}

    <label>Priority
        <select name="priority">
            <option value="low">Low</option>
            <option value="normal" selected>Normal</option>
            <option value="high">High</option>
            <option value="urgent">Urgent</option>
        </select>
    </label>

    <!-- Anything named meta:* is stored on the ticket and shown to staff -->
    <input type="hidden" name="meta:product" value="Acme Theme">
    <input type="hidden" name="meta:version" value="2.4.1">

    <button type="submit">Send request</button>
{/exp:wrangler:submit_form}

support/ticket

Segments are support/ticket/{reference}/{token}, so {segment_3} is the reference and {segment_4} is the token. A signed-in member can omit the token entirely.

{exp:wrangler:ticket reference="{segment_3}" token="{segment_4}"}

    <h1>{reference} — {subject}</h1>
    <p>Status: {status_label} &middot; Opened {created_at format="%F %j, %Y"}</p>

    {messages}
        <article class="{if is_staff}from-staff{if:else}from-customer{/if}">
            <h2>{author_name}</h2>
            <time>{created_at format="%F %j, %Y, %g:%i %a"}</time>
            <div>{message}</div>
        </article>
    {/messages}

    {if no_results}
        <p>We could not find that ticket. Check the link in your email.</p>
    {/if}

{/exp:wrangler:ticket}

{exp:wrangler:reply_form reference="{segment_3}" token="{segment_4}"}
    {if error}<p class="error">{error_message}</p>{/if}
    <label>Add a reply <textarea name="message" required>{message}</textarea></label>
    <button type="submit">Send reply</button>
{/exp:wrangler:reply_form}

support/mine

For signed-in members only.

{exp:wrangler:tickets status="open" limit="25"}
    <a href="{path='support/ticket'}/{reference}">{reference} — {subject}</a>
    <span>{status_label}, updated {last_message_at format="%Y-%m-%d"}</span>
    {if no_results}<p>You have no open tickets.</p>{/if}
{/exp:wrangler:tickets}

support/thanks

Anything you like. This is where return= lands after a successful submit.

support/recover

The "lost your link?" page, linked from thanks and from the ticket page's not-found message.

{exp:wrangler:recover_form return="support/recover"}
    {if success}<p>{success_message}</p>{/if}
    {if error}<p class="error">{error_message}</p>{/if}
    <label>Your email <input type="email" name="email" value="{email}" required></label>
    <button type="submit">Email me my links</button>
{/exp:wrangler:recover_form}

Update sample templates adds this page to a group installed by an earlier version, even when Also replace the page templates is left unticked: it is new, so there is nothing of yours to overwrite.