ExpressionEngine Docs

Template Manager

Control Panel Location: Developer > Templates

The Template Manager allows you to create, edit and delete Template Groups and Templates. Clicking a particular Template Group name will reveal that Group so that you can work with it.

Create Template

Control Panel Location: Developer > Templates > Create New Template

This section of the Control Panel allows you to create a new template within a template group.

New template settings:

Edit Template

Control Panel Location: Developer > Templates > Edit

This section of the Control Panel allows you to edit a templates contents and settings.

Clicking on a line number will select the whole line.

This page has the following tabs:

Edit

The content of the Template.

Notes

The Template Notes tab enables you to save notes and information about your template. This information is available only in this page.

Settings

Access

Note: If you are running PHP-FPM / FastCGI, you will probably need to add this to your .htaccess so the server makes the necessary environment variables available to PHP & ExpressionEngine.

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

or:

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Template Routes

Control Panel Location: Developer > Templates > Template Routes

The Template Route Manager shows all templates that are assigned a template route and allows you to add, edit and manage your Template Routes.

Routes are listed in the order that the Template Router will match your templates.

Routes have the following settings:

Email Templates

Control Panel Location: Developer > Templates > Email

This section of the Control Panel is for the various “notification” emails that are sent by the system. For example, when someone registers at your site, account activation instructions are emailed to them. The formatting of the email is controlled in one of the Message Pages.

Forum Templates

Control Panel Location: Developer > Templates > Forums

The ExpressionEngine Forums make use of “themes” to determine how they are displayed. The Forum Module comes with a “default” theme, which is located in your installation under themes/forum_themes/.

In order to edit the Templates inside the Control Panel, set the theme folders and files to be writable. See File Permissions for details.

If you plan to make changes to your theme, we recommend that you make a copy of the themes/forum_themes/default/ directory, name it something else, and make your changes to that one. You can easily switch themes simply by choosing a new one under Default Preferences.

For anyone creating their own theme or modifying one, the original “PSD” version of the “ExpressionEngine Forums” graphic is available for download.

Member Profile Templates

Note: The Member Profile Templates are legacy as of ExpressionEngine 6. If you have to use them, it is required to set legacy_member_templates config override.

Control Panel Location: Developer > Templates > Members

The public profile area has its own set of templates which can be edited to change the look. You’ll find the templates located at:

themes/ee/member/default/

A good strategy is to make a copy of the entire default templates folder, then edit your copy so you can leave the default files intact. Save your new copy to:

themes/user/member/custom_theme_name/

You can set your new copy as the site default under Settings --> Members

Note: When building your member profile templates, consider that any external links will pass along referrer data. This can cause security problems if someone clicks on an external link from a secure page. For example, if a user clicks an external link from the password reset page, the external site could use the password reset link from the referrer data to gain access to a user’s account.

You can strip everything but the base URL by linking to {path=""}?URL=<your url>.

System Message Templates

Note: As of ExpressionEngine 6, it is possible to use standard templates for custom system messages. Please find the details in Custom System Messages section below.

Control Panel Location: Developer > Templates > Messages

This section of the Control Panel is for managing the system message templates, such as the Site Offline template and the User Messages template.

In the General Settings section of the Control Panel you can specify whether or not your site is “Live”. If the site is not live then people will be presented with a message when they try to access your page. This can be useful if you are performing maintenance or other such things. This Message Page allows you to define the page that will be shown to people when your site is not “Live”.

Users often receive messages after performing actions in ExpressionEngine: logging in, submitting a form, etc. In addition, they may sometimes be shown error messages. You can determine how the page looks that displays these messages.

Custom System Messages

It is possible to display custom system messages to users by using standard ExpressionEngine templates.

In order to do this, you simply need to create a system_messages template group, and create a template named generic within the group.

At the bare minimum, it is required to have following variables in that template:

It is also recommended to have the following:

Additionally, the template may contain any other ExpressionEngine tags.

Sample System Message Template:

<html>
<head>
    <title>{title} | {site_name}</title>
    <meta http-equiv='content-type' content='text/html; charset={charset}' />
    {meta_refresh}
    <link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
</head>
<body>
<div class="flex items-center justify-center h-screen" >
    <div class="max-w-md rounded overflow-hidden shadow-lg ">

        <div class="px-6 py-4 bg-gray-100">
            <div class="font-bold text-xl mb-2">{heading}</div>
                <div class="text-gray-700 text-base">

                {content}

                <p class="text-indigo-500">{link}</p>

                <p>... or read our latest blog post {exp:channel:entries channel="blog" limit="1" dynamic="no" disable="custom_fields"}<a class="text-indigo-500" href="{path=blog/{url_title}}">{title}</a>{/exp:channel:entries}</p>
            </div>
        </div>
        <div class="px-6 pt-4 pb-2 bg-gray-100">
            <span class="inline-block bg-gray-400 rounded-full px-3 py-1 text-sm font-semibold text-gray-700 mr-2 mb-2">#EE6</span>
            <span class="inline-block bg-gray-400 rounded-full px-3 py-1 text-sm font-semibold text-gray-700 mr-2 mb-2">#new-features</span>
        </div>
    </div>
</div>
</body>
</html>

Template Partials

Control Panel Location: Developer > Templates > Template Partials

In this section of the Control Panel you can create and edit Template Partials.

Template Variables

Control Panel Location: Developer > Templates > Template Variables

In this section of the Control Panel you can define custom data that you would like to be available globally in any Template. This is in addition to the standard Global Template Variables that are already available.

You could create a Global Variable for any number of purposes. One idea would be for a piece of copyright text that would be included on every page. By making it a Global Variable you can change it in one place and immediately see the effects everywhere.

Global Variables can contain text, HTML, javascript, etc. but cannot contain PHP code or ExpressionEngine tags that you wish to have parsed.

Create/Edit Template Group

Control Panel Location: Developer > Templates > New/Edit

Tip: Custom Ordering Template Groups

This section of the Control Panel allows you to create or edit a template group.

Export Templates

Control Panel Location: Developer > Templates > Export

Export All Templates icon Clicking the Export All Templates Icon will download all templates, partials, and variables as a compressed *.zip archive.