A lifelog of a well-travelled single parent who had a life extension in 2000, blogs indiscriminately about her journey through life fulfilling unfinished business and promises that will soon complete her existence...

::Template Modules Added

Sunday, February 08, 2004

For barely 6 weeks of using Movable Type, only this time I fully noticed Template Modules. I created and added Header, Sidebar, and Footer Template Modules AND deleted long html tags off Category Archive, Date-based and Individual Archive Templates. I was hesitant at first that it might not work but, glad I tried.

Template Modules

Movable Type allows you to extract common chunks of HTML code into templates that you can then include in your other templates; in Movable Type, these common templates are called Template Modules. An example of the use for such a template might be a header that you use throughout your site. You can create a new template module called Header, paste in the common header code, then save the new template. You can then include this code in all of your other templates using the MTInclude tag:

< $MTInclude module="Header"$ >

This tag will be replaced by the contents of the Header custom template.

This allows you to keep all common code in one place, so that if you need to modify it, you only need to modify it in one place.

Source: Movable Type User Manual: TEMPLATES

When I need to edit my sidebar to add some new links, all I have to do is open my sidebar template module and changes will be reflected in all archive templates when rebuild!

Editing my archive templates are now easier since it has less html tags :-)


Posted on February 8, 2004 11:14 AM


butterfly Let me know you were here, your thoughts are welcome!

I am considering of learning php real soon, I still do not understand the codes...


Posted by: Laila* on February 8, 2004 10:18 PM

Sorry code did not post come online on YIM or send me an email and I will guide you through it !


Posted by: Arvind on February 8, 2004 10:09 PM

Template modules greatly increase rebuild time. Why don't you do the
same thing with php. Create an index template for each template module
you have and add the appropriate corresponding code from the module.
Then you will need to replace < $MTInclude module="module"$ >
with <? include ( " /absolute/path/to/file.php " ); ?> make sure all
files have a .php extention !


Posted by: Arvind on February 8, 2004 10:08 PM


butterfly
© 2003-2007 Laila*
This site is licensed under a Creative Commons License.