Personal tools
You are here: Home なごぶろ カテゴリリストでもアイコンを表示しようかなと。
About this blog
なごすいぶろぐ。「すべてはなごすいのために」。
Categories
COREBlog2 (31)
Zope (61)
Linux (26)
Misc (47)
Nagosui (11)
ReadingCOREBlog (7)
Plone (81)
Python (20)
Turbogears (18)
COREBlog1 (30)
moblog (5)
Django (12)
 
Document Actions

カテゴリリストでもアイコンを表示しようかなと。

とりあえずindex_htmlのカテゴリにはアイコンが表示されるようになったけど、カテゴリリスト(categorylist_html)にもアイコンを表示させたいので以下のように変更。

<dtml-comment>
* Show all categories in the blog .
</dtml-comment>
<div class="category">
<dtml-in category_list>
<dtml-if name="icon_path">
<a href="<dtml-var blogurl missing="">
/categorylist_html?cat_id=<dtml-var id>">
<img src="<dtml-var icon_path>">
</a>
<dtml-else>
<a href="<dtml-var blogurl missing="">
/categorylist_html?cat_id=<dtml-var id>">
[<dtml-var name missing="category name is missing">]
</a>
</dtml-if>
</dtml-in>
</div>


これでカテゴリの名前の代わりにアイコンが表示されるようになった。

しかしどうだろう。アイコンだけでいいのかな。Gentooのロゴみたいに比較的有名でわかりやすいものならいいけど、もしアイコンがわかりにくかったら?ちょっとあかん。
名前とアイコン両方を表示させよう。index_htmlの方は今のままアイコンだけ表示でいいや。
とりあえずtableでやってみる。
一行目にアイコン、二行目にカテゴリの名前で、カテゴリの数だけ列がある、というふうで。

<dtml-comment>
* Show all categories in the blog .
</dtml-comment>
<div class="category">
<table>
<tr>
<dtml-in category_list>
<td>
<dtml-if name="icon_path">
<a href="<dtml-var blogurl missing="">/
         categorylist_html?cat_id=<dtml-var id>">
<img src="<dtml-var icon_path>">
</a>
</dtml-if>
</td>
</dtml-in>
</tr>
<tr>
<dtml-in category_list>
<td>
<a href="<dtml-var blogurl missing="">
        /categorylist_html?cat_id=<dtml-var id>">
[<dtml-var name missing="category name is missing">]
</a>
</td>
</dtml-in>
</tr>
</table>
</div>


さて、どうなるかなぁ…。

うーむ。できたはできたけど、きたないなあ…。css設定しないとダメだなぁ。table使うのも微妙だなぁ。次の課題はcssですかな。
The URL to Trackback this entry is:
http://nagosui.org/Nagosui/COREBlog2/20/tbping
Add comment

You can add a comment by filling out the form below. Plain text formatting.

(Required)
(Required)
(Required)
(Required)
Enter the word