When I built the blog system for Leafhhou, I found the page code is hard so that I can't reuse parts of code. It is bad smell. And it is hard to read the source code. For example, if you want to find the section of Copyright , the way is either using the find dialog, or reading more and more carefully. If you want to change it, you must change it on several pages. it is bitter.
To improve it, MT supports templates and widgets functions. I try to use this function when building the new web blog system. The result is below:
OK, let me explain it.
Suppose that a Search form is used in several pages. To reuse it, the best way is to build a template, which includes the search part.
Where to create one template?
Just easy. Hover your mouse to "Design" , and a menu will pop up, click "Templates", you can create one here.
How to create?
Just copy the HTML code.
How to use template in the page?
Easy too. use the directive <$mt:include module="your_module_name" $> or <$MTInclude module="module name"$>.
That is all. easy? yes.
Seems I will have to spend much time improving the system.
To improve it, MT supports templates and widgets functions. I try to use this function when building the new web blog system. The result is below:
- Templates are used friendly
- If you use widgets as templates, please give up your ideas, because it does not make sense.
OK, let me explain it.
Suppose that a Search form is used in several pages. To reuse it, the best way is to build a template, which includes the search part.
Where to create one template?
Just easy. Hover your mouse to "Design" , and a menu will pop up, click "Templates", you can create one here.
How to create?
Just copy the HTML code.
How to use template in the page?
Easy too. use the directive <$mt:include module="your_module_name" $> or <$MTInclude module="module name"$>.
That is all. easy? yes.
Seems I will have to spend much time improving the system.
