Archiva

A note of notions. On web, tech, and others.



最初のエントリと、以後のエントリで表示を変える

Blosxomで最初のエントリと、その他のエントリで出し方を変える方法。プラグイン「push_if_first」と「interpolate_fancy」が必要。

コードは以下。

  1. <?$push_if_first::is_first like="(^1)">
  2. <h2><a href="$url$path/$fn.html">$title</a></h2>
  3. <h3>mo $da, $yr at $hr12:$min $ampm</h3>
  4. $body
  5.  
  6. <h2>最近の10件</h2>
  7. $push_if_first::data
  8. </?>
  9. <?$push_if_first::is_first like="(^0)">
  10. <dt><a href="$url$path/$fn.html">$title</a></dt>
  11. <dd class="posted">mo $da, $yr at $hr12:$min $ampm</dd>
  12. </?>

例では、1つ目のエントリはh2(タイトル)、h3(日付)、そして本文が表示される。他はdlリスト(タイトル、日付のみ)で表示。

push_if_firstが出力する数字を、条件分岐ができるinterpolate_fancyで評価するのがコツ。「$push_if_first::data」で<dl>を、footフレーバーで</dl>を出力している。interpolate_fancyの使い方は別エントリで。

なお、出力されるソースのインデントは、適当に調節してください。

Posted in /web/blosxom
ブックマークする: save to del.icio.us はてなブックマーク livedoor クリップ Google Bookmarks Tumblr

コメントする

名前
Webサイト
コメント



Back to page-top