最近の更新

関連


その他いろいろ

多機能フィードリーダSynapse製作中

2月までは目が回るほど忙しい

MODxでつくる! 最強のCMSサイト カバー
MODxでつくる! 最強のCMSサイト

Cascading Templates (English)

Cascadeing Templates plugin
初出:2007年04/30 更新:2007年04/30

この文書のキーワード: PHP, MODx

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".

  1. Divide t.outer.inner by dots, and obtain template name "t", "t.outer"
  2. If exists, put "t.outer.inner" into "t.outer"
  3. In the same way, put "t.outer" into "t"
  4. The plugin's job is done. MODx merges the document content to the built template.
Template creation example Output example

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 DL2007 04/30テンプレート階層化