Blog Top
SoyCMS 更新歴

SoyCMSブログのアレンジ04 ・・・記事にカテゴリ名を表示

SoyCMSマニュアル「トップページで利用可能なブロック」

cms:id の category_name が記事に付けられたカテゴリー名を表示するようです。

エントリーの記述の中に category_list とセットで category_name を追加します。

<!-- b_block:id="entry_list" エントリーの記述-->
 <div class="entry">
  <ul class="posted-cat"> 
  <!-- cms:id="category_list" -->
   <li><a cms:id="category_link"><!-- cms:id="category_name" --><!-- /cms:id="category_name" --></a></li>
  <!-- /cms:id="category_list" -->
  </ul>
  <h2 class="title">
  <!-- cms:id="title" -->エントリータイトル01<!-- /cms:id="title" -->
  <!--  cms:id="sub-title-span" -->タイトルspan<!-- /cms:id="sub-title-span" -->
  </h2>
  <!-- cms:id="sub-title-under" -->サブタイトル<!-- /cms:id="sub-title-under" -->
  <div cms:id="content">記事本文</div>
  ---略---
  </div>
<!-- /b_block:id="entry_list" エントリーの記述ここまで-->

---CSS---
.entry ul.posted-cat {
	width:500px;
	position:absolute;
	top:-8px;
	right:20px;
}
.entry ul.posted-cat li {
	width:auto;
	float:right;
	background-color: #888;
	border-radius: 3px;
	padding: 1px 3px;
	margin-left:3px;
	font-size: 0.9em;
}
.entry ul.posted-cat li a {	
	display:block;
	color: #ffffff;
}
.entry ul.posted-cat li a:hover {	
	color: #555;
}

記事にカテゴリー表示

2013.09.11 | Trackback(0)

お名前: 

←「ひとこと」と入力してから送信ボタンをクリックして下さい。