Retired Documentation: You are using the documentation for version 1.7.3 which was retired in 2013. Go here for the latest version documentation or check here for your available upgrades to ExpressionEngine 3.
Using the Template Library
The Template Library enables you to store your own templates so that whenever you create a new template you can base it on one from your Template Library.
The system/templates/ folder is where templates for your library are stored. Each template is a separate text file.
Adding Templates to Your Library
To add a template to your library create a plain text file containing your template data. Name it using this format:
So, if you wanted to make a "comments" type Template, you might name it comments.tpl.
The name you've given a file is is what will appear in the Template Library drop-down list when you create new templates.
Let's say you wish to add a "comments" template to your library to make it easy to start new Templates based off of it. In order to do this, you would follow these basic steps:
- Create a new text file. Name it comments.tpl.
- Edit the text file. Copy the entire content from your current "comments" Template in the Control Panel and paste it into your new file. Save the file.
- Upload your comments.tpl file to system/templates/ so it would be located at system/templates/comments.tpl.
Now, when you go to create a new Template, you will see a "comments" entry populating the Template Library drop-down list. If you choose that option during Template creation then you will see that your Template begins with the code that you placed in the file.
You may also organize your Template files into sub-folders under system/templates/. Using this method, you could end up with something like this: