Friday, March 29 2024 @ 04:33 AM JST

Geeklog Assist 新着記事自動タグの活用

  • Sunday, August 25 2013 @ 12:20 AM JST
  • 投稿者:
  • 表示回数 8,145
Geeklog

Geeklog [tag:Assist]プラグインは多数の自動タグ(Autotags)を提供していますが、そのなかのひとつ、新着記事自動タグは、本サイトでも活用しているように新着記事一覧を表示するのに活用します。

Assist: document(詳細ドキュメント)

本サイト活用例:

静的ページの作成

静的ページに、以下の[tag:自動タグ]を入力して、ホームページのTOPに表示するモードで保存します。

<div>[assist:newstories topics:Geeklog  title_trim_length:50 intervalday:70 limitcnt:5 newmarkday:3 thtml:default]</div>

トリミング50文字、70日、最大カウント40件、新着マーク表示3日のオプションを付けています。すべての話題を指定する場合は、topic:ALL とします。

[lightbox:https://www.ivysoho.net/images/library/Image/geeklog/staticpage_assist.png width:200 height:300]

Assist プラグインのテンプレート調整

テンプレートは以下のように修正します。

<!-- plugins/assist/templates/newtories/default/stories.thtml  { -->

<dl class="assist_stories">
{stories_col}
</dl>

<p class="assist_rss"><a href="{rss_url}">{rss_title}</a></p>
<p class="assist_more"><a href="{more_url}">{more_title}</a></p>

<!-- } plugins/assist/templates/newtories/default/stories.thtml -->
<!-- plugins/assist/templates/stories_col.thtml { -->

<dt class="assist_date">{day}</dt>
<dd class="assist_stories"><a href="{url}">{title}</a>{new_img}</dd>

<!-- } plugins/assist/templates/stories_col.thtml -->

css

dl dt dd に横並びのレイアウトを追加します。

dl.assist_stories {  
 width:400px;  
}  
dl.assist_stories dt.assist_date {  
  float:left;  
  width:10em;  
  padding:0;  
  clear:left;  
  font-weight:bold;  
  margin: 0;  
}  
dl.assist_stories dd.assist_stories {  
  margin: 0 0 0.5em 0;  
  padding-left: 10em;  
}
dl.assist_stories dd.assist_stories span.assist_new { 
  padding: 1px 4px;
  margin:  0 0 0 0.5em;
  background: #ffaaaa;
  color: #ffffff;
  font-weight: bold;
  font-size: 10px;
  font-family: Arial;
}
p.assist_more {
  text-align: right;
}

Assistプラグインのコンフィギュレーション

新着マークをデフォルトは画像ですが、以下のタグに変更します。

<span class="assist_new">New!</span>

[lightbox:https://www.ivysoho.net/images/library/Image/geeklog/staticpage_assist_new.png width:200 height:300]

「テンプレート 一般画面」「テンプレート 管理画面」は、標準、カスタム、テーマの3つから選べます。

標準 参照パス(Standard):plugins/assist/templates/
カスタム 参照パス(Custom):plugins/assist/custom/templates/
テーマ 参照パス(Theme):公開領域/layout/(Theme)/assist/templates/

Download Assist プラグイン

Assist プラグイン

[lightbox:https://www.ivysoho.net/images/library/Image/geeklog/staticpage_assist_download.png width:450 height:auto]

Download Geeklog