Expression Engine Embeds: Functioning like PHP Includes
One of the first things that people who are new to Expression Engine get confused about are static pages, and how you can set up templates that act as PHP includes. Expression Engine has it's own very simple set of template tags to perform this function, called Embeds. I use embeds constantly, and they're fantastic because the markup is short and simple, and it sure beats editing your pages manually.
This tutorial assumes you have a basic grasp of how to use templates in EE.
The first thing you're going to need are obviously your main site templates. These are the templates you see when you click on "Templates" from your admin panel's menu bar, and contain links to your "site_css" and "archives" pages, etc. If you've ever noticed the path to these templates up top while you're editing one, you'll know that it says "site/your template." Site is the Template Group where all of your templates are stored.
In order to utilize Embeds, you need to create a new custom group. But first, I'm going to explain the basic setup of your template groups.
In the first column, you'll notice where it says "Choose Group," and contains a list of links to all of the different template groups you have. By default, you have 2 template groups: your main site group and your search group.
In the second column, you'll see another list of links that allow you to perform different functions for the templates inside your particular group. From this column, you can create a new blank template, edit preferences etc.
Now to the embeds. In the far right corner, you'll notice a big green button that says, you guess it, "Create a New Template Group." By clicking this, you're creating a new section for separate templates.

You'll see an input box where you'll need to enter a name for your template group. For my embeds template group, I've chosen to name them "Includes" because it makes sense. You also have the option of duplicating another template group, but for now we are just going to create a blank one. Enter the name of your group, and click submit. Note: Do NOT check the option that makes the template group your index page.
After you click submit, you'll be forwarded back to your main templates page. Go back over to the first column, and click on the template group you've just created. You'll notice the group is empty and only contains an index template (this will remain blank, no need to mess with it.)
Go to the second column, and click on "New Template." Enter the name of your first template, choosing a name like "header" so you'll know what it contains. From here on, it's just like using PHP includes. You're going to need to seperate your header and footer data from your content.
At the bottom, check the option that states "None- create an empty template" and click submit. Click on the template you've just created and enter all of your header information into it. It might look something like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Your Title</title>
<meta HTTP-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
</head>
<body>
<div id="container">
<div id="masthead">
<div class="logo">
<a href="http://yoururl.com"><img src="http://yoururl.com/images/logo.png" alt="Go Home" /></a>
</div>
<div id="content">
Click submit, and you'll once again be forwarded to your template group. Follow the same steps for creating your footer template.
You're all done with these files, so go back to your main site template group. Now, you'll need to erase all the junk from your templates, and add the following code instead. It should look something like this:
{embed="includes/header"}
<h1>Hello!</h1>
<p>This is an example page using Expression Engine embeds to act as PHP includes! Awesome, right?</p>
{embed="includes/footer"}
Notice how the basic setup resembles PHP includes? Except in this case, the markup is shorter, and much easier to remember. Change the rest of your pages to the setup above, and you're finished! It might seem complicated at first, and you'll probably get confused more than once navigating through your different groups, but you'll quickly get the hang of it.
As you can see, embeds are incredibly useful. You can change the look of every webpage on your site by creating new template groups for each, and embeds also help when you have more than one weblog running from your one EE install. I hoped this helped at least a few of you out, and my apologies for being all over the place. If you have any questions, feel free to leave them in the comments section and I'll do my best to explain further.

