Cascading Templates (English)
This document is a translation of original Japanese document. I am afraid of so much grammatical errors included below. If you could, I would be glad to have pointing out of those or the unclear meanings. (Gmail: uglydog.7bit)
Creating a web site with MODx, you might have a dilemma that althogh outside of the page is the same, a new template bit different in inside is required because of different content type. You can either copy and paste the same code, or use chunk to avoid the situation, but conservativeness or legibility is impaired.
With Cascading Templates plugin, the layered template structure represented by a delimiter (a dot by default) can be handled. Sure, the benefit is trade off with the calculation quantitative cost, but only twice call of SELECT statment is not so heavy.
Example
Here is an example. The exact template applied to the document is "t.outer.inner".
- Divide t.outer.inner by dots, and obtain template name
"t","t.outer" - If exists, put
"t.outer.inner"into"t.outer" - In the same way, put
"t.outer"into"t" - The plugin's job is done. MODx merges the document content to the built template.
Usage
System event: OnLoadWebDocument is used.
Notice
In the view of MODx, document's template is the actual one that specified, so please check "enable" TV for inner templates to use them.
Downloads
| バージョン/DL | 日付 | 概要 |
|---|---|---|
| 1.00 | 2007 04/30 | テンプレート階層化 |
