テンプレートのプラグイン対応化は、面倒ではなかった

 個人的なメモ。
 既存のテンプレート(2カラムの物)を、とりあえずプラグイン機能に対応させる方法。

 まず、HTMLファイルの中で、サイドバー関係のブロックを、

<!–not_plugin–>〜<!–/not_plugin–>

 で括ってしまう。

 その前後(が分かりやすいと思われる)に、

<!–plugin–>

<!–plugin_first–>
<h2><%plugin_first_title></h2>
<p>
<%plugin_first_description>
</p>
<%plugin_first_content>
<p>
<%plugin_first_description2>
</p>
<!–/plugin_first–>

<!–plugin_second–>
<h2><%plugin_second_title></h2>
<p>
<%plugin_second_description>
</p>
<%plugin_second_content>
<p>
<%plugin_second_description2>
</p>
<!–/plugin_second–>

<!–plugin_third–>
<h2><%plugin_third_title></h2>
<p>
<%plugin_third_description>
</p>
<%plugin_third_content>
<p>
<%plugin_third_description2>
</p>
<!–/plugin_third–>

<!–/plugin–>

 を挿入する。
 サイドバーのid指定とかclass指定は、それぞれに入れておけばいい。

コメント