|
The Metadata Plugin Metadata Management for Manila |
Site last updated 2/24/2006; 12:33:21 PM |
|
Multiple Templates and Subtemplates in Manila
Here's how to implement subtemplates and multiple templates in Manila. The technique is the same for both. This assumes you have the Metadata Plugin 1.5 or later installed. Important: if you have just updated to version 1.5, you must disable, then enable the plugin. This updates the pageFilter architecture. First, we need to set up a meta type that will be your Template Selector. All this means is that we're going to add a column to our website that will denote which template will be used. Here's the way our website might look before:
MsgNum Subject PostedBy When ------ --------------------- --------------- ------------------- 1 How to frisk a cat mo@zzzzzzz.com 5/16/00; 3:39:24 PM 2 Getting rid of fleas mo@zzzzzzz.com 5/16/00; 3:42:10 PM 3 Shedding on the rug mo@zzzzzzz.com 5/16/00; 3:55:33 PM and here's how it would look after:
MsgNum Subject PostedBy When Template ------ --------------------- --------------- ------------------- ------------ If you need a refresher on these concepts, reread Why the Metadata Plugin is Important Anyway, I like to call my Template meta type Template or Section. That way I don't get confused. Now I have to decide which templates I'm going to create. In this example we're only going to create one new template, but you may create as many as you like. I already have a template -- the default template for my Manila site. I could edit it in the normal way, by clicking on Prefs --> Advanced. But now it's time to create a new template. I'm going to call it How-To and on this cat site I'll create a special logo with a smart-looking cat that will appear only in the How-To template. Or maybe I'll just change the font color. The first thing I do is to log in as Managing Editor. This gives me my Editors Only menu. I click on metaData to reach the Manage Meta Types page (if metaData is not an option, you probably don't have the Metadata Plugin installed or enabled. See this page.) If I haven't created the meta type named Section or Template, now is when I would do it. I actually prefer to use Section instead of Template because it's a more comfortable idea. Rather than thinking about a page being assigned a template, I like to think of which section of the site the page is in, and as a corollary: that section has a template. You can then dual-purpose that meta type by using it to build your site index (see "How to Create an Automatic Site Index"), use "The showrelated() Macro", etc. So I've created my Section meta type. It looks like this:
The resulting page says "Entry for Section = How-To added", so I know it worked. If you've ever set up value lists in FileMaker pro, this is the same type of procedure. Now I go back to my Manage Meta Types page because I'm ready to edit my new template. Notice that at the bottom of the Manage Meta Types page, under Options, is an option called Multiple Templates. Click on it. It asks me which template I want to use as my Template Selector. Of course, I want to use Section...that's why I created it. I'm also going to create a new template called How-To. Notice that the name of the template is the same as the value I just added to the index for Section. They must be the same because that's how the Metadata Plugin figures out which template to use.
Now my new template is listed, and I can click on its name to edit the actual template:
When I click on the name of the template, I get a standard textarea field that I can edit to my heart's content. Or I could paste in a template I created in DreamWeaver, or whatever. Notes on templates:
For this example, I just want to make all the text on the page red. So my How-To template looks like this:
Now when I'm editing a page in Manila and I choose How-To for the Section meta type, like this,
the resulting page uses my template, and the text is annoyingly red:
Have fun!
|
||||||||||||||||||||
| This page last updated Wednesday, September 6, 2000 at 5:02:42 PM. | (7495) |