You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In addition to HTML and other markup, templates usually contain [ExpressionEngine Tags](templates/language.md), which allows information to be served dynamically.
37
37
38
-
## Creating a Template
38
+
## Creating & Editing Templates
39
39
40
40
Templates can be created and edited in the `Developer -> Templates` area of your Control Panel.
41
41
42
-
ExpressionEngine, by default, saves Template Groups, Templates, Global Variable, and Template Partials as regular folders and files on your server at `system/user/templates`. This allows you to use your preferred text editor to edit Templates and then FTP the changes to the server.
42
+

43
+
44
+
You start off by creating template group. When creating, you will have options to duplicate existing group with all templates in it. You are also able to select the roles that will have editing permissions for templates in this group.
45
+
46
+
Then, create individual templates. You can duplicate existing template, or create blank one. If necessary, change the template type from "Webpage" to the type that you need (RSS Page, CSS, JavaScript, Static, XML)
47
+
48
+
Existing templates can be edited with built-in editor, which provides intelligent syntax highlighting.
49
+
50
+
TIP: **Tip:** The font size in template editor can be adjusted with a [configuration override](general/system-configuration-overrides.md#codemirror_fontsize).
51
+
52
+
You can also edit template preferences and set front-end access permissions for it.
53
+
54
+

55
+
56
+
## Saving templates as files
57
+
58
+
Templates are always saved into database, however they can also be saved as files by setting [system configuration override](general/system-configuration-overrides.md#save_tmpl_files)in `system/user/config/config.php`:
59
+
```php
60
+
$config['save_tmpl_files'] = 'y';
61
+
```
62
+
ExpressionEngine, by default, saves Template Groups, Templates, Global Variable, and Template Partials as regular folders and files on your server. The directory structure would be similar to shown below
63
+
64
+
```
65
+
|-- system
66
+
| |-- user
67
+
| | |-- templates
68
+
| | | |-- _global_partials
69
+
| | | | |-- _header.html
70
+
| | | | |-- _footer.html
71
+
| | | |-- _global_variables
72
+
| | | | |-- logo.html
73
+
| | | |-- default_site
74
+
| | | | |-- _partials
75
+
| | | | | |-- sidebar.html
76
+
| | | | |-- _variables
77
+
| | | | | |-- address.html
78
+
| | | | |-- blog.group
79
+
| | | | | |-- entry.html
80
+
| | | | | |-- feed.xml
81
+
| | | | | |-- index.html
82
+
| | | | |-- home.group
83
+
| | | | | |-- contact.html
84
+
| | | | | |-- about.html
85
+
| | | | | |-- index.html
86
+
| | | | |-- styles.group
87
+
| | | | | |-- contact.css
88
+
| | | | | |-- index.css
89
+
| | | |-- second_msm_site
90
+
| | | | |-- _partials
91
+
| | | | | |-- sidebar.html
92
+
| | | | |-- _variables
93
+
| | | | | |-- address.html
94
+
| | | | |-- home.group
95
+
| | | | | |-- about.html
96
+
| | | | | |-- index.html
97
+
```
98
+
99
+
This allows you to use your preferred text editor to edit Templates and then FTP the changes to the server.
100
+
101
+
`default_site` and `second_msm_site` are the site short names if you're running [Multiple Site Manager](msm/overview.md). If you have just one site, `default_site` is going to be the only one you need.
102
+
103
+
`_partials` folder will be holding your [template partials](templates/partials.md) for the site, and `_global_partials` will be holding partials that are shared through all MSM sites.
104
+
105
+
`_variables` folder will be holding your [template variables](templates/variable.md) for the site, and `_global_variables` will be holding variables that are shared through all MSM sites.
43
106
44
107
These are the naming rules that ExpressionEngine applies to these resources:
45
108
@@ -52,7 +115,9 @@ These are the naming rules that ExpressionEngine applies to these resources:
52
115
-_.xml_ creates an 'xml' template type
53
116
- Template group names (not including the .group) and template names (not including the .extension) are limited to 50 characters. Anything longer than that will be truncated by the database and fail to match the file.
54
117
55
-
You can also choose to save templates in the database using this [system configuration override](general/system-configuration-overrides.md#save_tmpl_files).
118
+
Having several templates with same name but different extensions is not supported.
119
+
120
+
The existing templates are syncronized with the files as soon as any site page is accessed. However if you created new template or new template group on file system, you need to visit `Developer -> Templates` section of Control Panel in order to have them created in database.
0 commit comments