This was posted by Rick Ellis in our forums.
We’re in the process of writing some tutorials. Here’s a quick excerpt with some basic info.
Table of Contents
- Weblogs and Templates
- Templates
- Template Groups
- Anatomy of EE URLs
- Weblogs
- ExpressionEngine Tags
- Summary:
Weblogs and Templates
ExpressionEngine, at it’s most fundamental level, consists of two main parts: Weblogs and Templates.
Templates
When we refer to the term “template” we are usually referring to an HTML page. Your EE powered site will consist of, at minimum, one template, representing your site’s “index” or “home” page. Most sites have more than one template, of course, but at it’s most basic, your site will need at least one. If you visit your TEMPLATES page in the control panel, you’ll see a number of different templates. Each of these represents a specific page of your site. Templates are organized into Template Groups.
Template Groups
EE lets you organize templates into groups for better site organization. In fact, just as your site must have at least one template, it must have at least one Template Group. You can think of a template group as a folder containing templates. If you were to build a static HTML site, you might, for example, organize your weblog into a sub-folder on your server, like this:
www.your-site.com/blog/
In this example, “blog” is a folder. And of course, inside that folder you might have several web pages. The folder is simply an organizational tool.
Since EE is a virtual system there are no folders. However, you can think of a Template Group as a folder. Sort of a virtual folder that lets you organize your templates. EE permits you to have as many Template Groups as you want, and each one can contain an unlimited number templates.
Anatomy of EE URLs
Displaying your templates (as you would traditional web pages) requires that you understand how EE URLs work. EE URLs generally have the following URL structure:
http://www.your-site.com/index.php/template_group/template/
Notice that the Template Group and Template are contained in the URL. An Example: Let’s say you create a Template Group called “blog”, and within it you create a Template called “about_me”. To access it you will use the following URL:
http://www.your-site.com/index.php/blog/about_me/
If you use only the Template Group in the URL, EE assumes you want to show the “index” template for that group:
http://www.your-site.com/index.php/blog/
The above URL is identical to doing this:
http://www.your-site.com/index.php/blog/index/
Weblogs
To most people, a weblog is a set of web pages that present information a certain way. In ExpressionEngine, however, a weblog is simply a container for information - irrespective of the web pages. This is a very important concept, and one which people new to EE sometimes have trouble grasping, so let’s see if we can make it clear.
In most other publishing systems a “weblog” refers to the whole enchilada - information AND pages. Not in EE. A weblog is only the information, separate and independent from the pages (which we refer to as templates).
It might sound like we are splitting semantic hairs here, after all, you can’t show your weblog if you don’t have pages, right? Right...but! EE doesn’t make any assumptions regarding what YOU might want or need.
For example, let’s say you want to create an online magazine in which several independent weblogs are shown on the same page. Since EE doesn’t force you to have a specific set of pages for each weblog this is possible. Several weblogs can all live happily on a single page. Or you can have a more traditional blog on it’s own page. It’s your choice.
Important concept: A “weblog” in EE consists of information (weblog entries, comments, preferences). Templates are where you show your weblog. How you mix and match the two is up to you.
ExpressionEngine Tags
If you look inside any of the EE templates you’ll see that, in addition to HTML, they contain special tags. These tags are what allow your pages to show dynamic information. To show your weblog in a particular template requires that you put the “weblog” tag in it. There are dozens of tags available, and each one gives to a lot of control.
Summary:
A Template Group is a container similar to a folder.
A Template represents a single page of your site.
A Weblog consists of your entries, comments, preferences, and other related “data”.
ExpressionEngine Tags permit you to show elements of your weblog in your templates.
