Home | ArchiveList | Category | About
Home > NP_ArchiveIndex
カテゴリごとに記事リストを出したくなったので、最初は NP_TitleList を改修しようかと考えてたんですが、そういう用途のプラグインが実は最初からありましたね。

plugins:archiveindex [Nucleus CMS Japan Wiki]

解説が充実してるので、特に問題なく使えました。
一点だけ注意するのは、CSS設定例を有効化するにはスキンで "archiveindex" というクラスで囲っておく必要がある点でしょうか。

スキン記載例
<div class="archiveindex">
<%ArchiveIndex%>
</div>


毎回スキンに書くのもちょっと面倒なので、オプション設定に入れ込んで、スキン上ではクラス指定をやめました。

オプション設定例

Template: List (begin)
<div class="archiveindex"><table><thead title="%catdesc%"><th><a href="%caturl%">%catname%</a></th><th></th></thead><tbody>

Template: List (end)
</tbody></table></div>


幾つか個人的な用途にあわせて、改造を行いました。

(1)cdesc(カテゴリの説明)でカテゴリをソート

378行付近の //sort by category の else 文
else {
//20180306_takehana_upd_s
//ksort($arr_out);

$query = 'SELECT catid FROM '. sql_table('category') .' WHERE cblog='.$blogid.' ORDER BY cdesc ASC';
$cl_res = sql_query($query);
$arr_out2 = $arr_out;
$arr_out = array();
while ($clrank = mysql_fetch_object($cl_res)) {
$icatName = $b->getCategoryName($clrank->catid);
$arr_out[] = $arr_out2[$icatName];
}
$arr_out2 = '';
//20180306_takehana_upd_e
}


(2)カテゴリ名クリックでアーカイブリストではなくカテゴリリンクにする

// buffer category nameの下、255行目付近
//20180307_takehana_upd_s
//$arclist_link = createArchiveListLink($blogid, $extra);

$arclist_link = createCategoryLink($icat);
//20180307_takehana_upd_e


(3)Moreをアーカイブリストではなくカテゴリリンクにする

// category description with more link の下、317行目付近
$extra = array('catid' => $icat);
//20180307_takehana_upd_s
//$arclist_link = '<a href="'. createArchiveListLink($blogid, $extra) .'">&raquo; More</a>';

$arclist_link = '<a href="'. createCategoryLink($icat) .'">&raquo; More</a>';
//20180307_takehana_upd_e


(4)カテゴリ未選択時でも、個別記事をカテゴリ選択状態にする

//buffer item titleの下、271行目付近
//20180307_takehana_add_s
if(strpos($itemlink,'&catid=') === false){
$itemlink = $itemlink . "&catid=" . $icat;
}
//20180307_takehana_add_e
$idetail = $list_item[$inumber]['idetail'];


(5)Back to index をアーカイブリストではなくトップ移動にする

and make 'all category link'の下、376行目付近
//20180307_takehana_upd_s
//$arclist_link = '<a href="'. createArchiveListLink($blogid) .'">&raquo; Back to index</a>';

$arclist_link = '<a href="'. createBlogidLink($blogid) .'">&raquo; Back to Home</a>';
//20180307_takehana_upd_e


これで希望する挙動になったので満足しました。


この記事へのコメント
Please JavaScript ON for comment. %3c%61%20%69%64%3d%22%6e%75%63%6c%65%75%73%5f%63%66%22%3e%3c%2f%61%3e %3c%66%6f%72%6d%20%6d%65%74%68%6f%64%3d%22%70%6f%73%74%22%20%61%63%74%69%6f%6e%3d%22%23%6e%75%63%6c%65%75%73%5f%63%66%22%3e %09%3c%69%6e%70%75%74%20%74%79%70%65%3d%22%68%69%64%64%65%6e%22%20%6e%61%6d%65%3d%22%61%63%74%69%6f%6e%22%20%76%61%6c%75%65%3d%22%61%64%64%63%6f%6d%6d%65%6e%74%22%20%2f%3e %09%3c%69%6e%70%75%74%20%74%79%70%65%3d%22%68%69%64%64%65%6e%22%20%6e%61%6d%65%3d%22%75%72%6c%22%20%76%61%6c%75%65%3d%22%69%6e%64%65%78%2e%70%68%70%3f%69%74%65%6d%69%64%3d%31%32%33%30%32%22%20%2f%3e %09%3c%69%6e%70%75%74%20%74%79%70%65%3d%22%68%69%64%64%65%6e%22%20%6e%61%6d%65%3d%22%69%74%65%6d%69%64%22%20%76%61%6c%75%65%3d%22%31%32%33%30%32%22%20%2f%3e %09 %09%09%3c%64%69%76%20%63%6c%61%73%73%3d%74%72%61%63%6b%62%61%63%6b%69%6e%66%6f%3e %09%09%09%3c%6c%61%62%65%6c%20%66%6f%72%3d%22%6e%75%63%6c%65%75%73%5f%63%66%5f%6e%61%6d%65%22%3e%4e%61%6d%65%3a%3c%2f%6c%61%62%65%6c%3e %09%09%3c%2f%64%69%76%3e %09%09%3c%69%6e%70%75%74%20%6e%61%6d%65%3d%22%75%73%65%72%22%20%73%69%7a%65%3d%22%34%30%22%20%6d%61%78%6c%65%6e%67%74%68%3d%22%34%30%22%20%76%61%6c%75%65%3d%22%22%20%63%6c%61%73%73%3d%22%66%6f%72%6d%66%69%65%6c%64%22%20%69%64%3d%22%6e%75%63%6c%65%75%73%5f%63%66%5f%6e%61%6d%65%22%20%2f%3e %09%09%3c%64%69%76%20%63%6c%61%73%73%3d%74%72%61%63%6b%62%61%63%6b%69%6e%66%6f%3e %09%09%09%3c%6c%61%62%65%6c%20%63%6c%61%73%73%3d%22%6c%61%62%65%6c%6e%61%6d%65%22%20%66%6f%72%3d%22%6e%75%63%6c%65%75%73%5f%63%66%5f%6d%61%69%6c%22%3e%55%52%4c%3a%3c%2f%6c%61%62%65%6c%3e %09%09%3c%2f%64%69%76%3e %09%09%3c%69%6e%70%75%74%20%6e%61%6d%65%3d%22%75%73%65%72%69%64%22%20%73%69%7a%65%3d%22%34%30%22%20%6d%61%78%6c%65%6e%67%74%68%3d%22%36%30%22%20%76%61%6c%75%65%3d%22%22%20%63%6c%61%73%73%3d%22%66%6f%72%6d%66%69%65%6c%64%22%20%69%64%3d%22%6e%75%63%6c%65%75%73%5f%63%66%5f%6d%61%69%6c%22%20%2f%3e %09%09%3c%64%69%76%20%63%6c%61%73%73%3d%74%72%61%63%6b%62%61%63%6b%69%6e%66%6f%3e %09%09%09%3c%6c%61%62%65%6c%20%63%6c%61%73%73%3d%22%6c%61%62%65%6c%6e%61%6d%65%22%20%66%6f%72%3d%22%6e%75%63%6c%65%75%73%5f%63%66%5f%65%6d%61%69%6c%22%3e%4d%61%69%6c%3a%3c%2f%6c%61%62%65%6c%3e %09%09%3c%2f%64%69%76%3e %09%09%3c%69%6e%70%75%74%20%6e%61%6d%65%3d%22%65%6d%61%69%6c%22%20%73%69%7a%65%3d%22%34%30%22%20%6d%61%78%6c%65%6e%67%74%68%3d%22%31%30%30%22%20%76%61%6c%75%65%3d%22%22%20%63%6c%61%73%73%3d%22%66%6f%72%6d%66%69%65%6c%64%22%20%69%64%3d%22%6e%75%63%6c%65%75%73%5f%63%66%5f%65%6d%61%69%6c%22%20%2f%3e %09%09%3c%64%69%76%20%63%6c%61%73%73%3d%74%72%61%63%6b%62%61%63%6b%69%6e%66%6f%3e %09%09%09%3c%6c%61%62%65%6c%20%63%6c%61%73%73%3d%22%6c%61%62%65%6c%6e%61%6d%65%22%20%66%6f%72%3d%22%6e%75%63%6c%65%75%73%5f%63%66%5f%62%6f%64%79%22%3e%43%6f%6d%6d%65%6e%74%3a%3c%2f%6c%61%62%65%6c%3e %09%09%3c%2f%64%69%76%3e %09%09%3c%74%65%78%74%61%72%65%61%20%6e%61%6d%65%3d%22%62%6f%64%79%22%20%20%63%6c%61%73%73%3d%22%63%6f%6d%6e%61%6d%65%22%20%63%6f%6c%73%3d%22%35%35%22%20%72%6f%77%73%3d%22%31%30%22%20%69%64%3d%22%6e%75%63%6c%65%75%73%5f%63%66%5f%62%6f%64%79%22%3e%3c%2f%74%65%78%74%61%72%65%61%3e %09%09%3c%62%72%2f%3e%3c%69%6e%70%75%74%20%74%79%70%65%3d%22%63%68%65%63%6b%62%6f%78%22%20%6e%61%6d%65%3d%22%6e%6f%74%73%70%61%6d%22%20%76%61%6c%75%65%3d%22%31%32%33%30%32%22%20%69%64%3d%22%6e%75%63%6c%65%75%73%5f%63%66%5f%73%70%61%6d%22%20%63%68%65%63%6b%65%64%3d%22%63%68%65%63%6b%65%64%22%20%2f%3e%3c%6c%61%62%65%6c%20%66%6f%72%3d%22%6e%75%63%6c%65%75%73%5f%63%66%5f%73%70%61%6d%22%3eチェックを外してください%3c%2f%6c%61%62%65%6c%3e %3c%69%6e%70%75%74%20%74%79%70%65%3d%22%68%69%64%64%65%6e%22%20%6e%61%6d%65%3d%22%74%69%6d%65%72%22%20%76%61%6c%75%65%3d%22%31%35%33%37%38%30%38%39%34%32%22%20%69%64%3d%22%6e%75%63%6c%65%75%73%5f%63%66%5f%74%69%6d%65%72%22%20%2f%3e %09%09%3c%62%72%20%2f%3e%3c%62%72%20%2f%3e %09%09%3c%69%6e%70%75%74%20%74%79%70%65%3d%22%63%68%65%63%6b%62%6f%78%22%20%76%61%6c%75%65%3d%22%31%22%20%6e%61%6d%65%3d%22%72%65%6d%65%6d%62%65%72%22%20%69%64%3d%22%6e%75%63%6c%65%75%73%5f%63%66%5f%72%65%6d%65%6d%62%65%72%22%20%20%2f%3e %09%09%3c%6c%61%62%65%6c%20%66%6f%72%3d%22%6e%75%63%6c%65%75%73%5f%63%66%5f%72%65%6d%65%6d%62%65%72%22%3e%53%61%76%65%20%59%6f%75%72%20%49%6e%66%6f%3c%2f%6c%61%62%65%6c%3e %09%09%3c%62%72%20%2f%3e %09%09%3c%69%6e%70%75%74%20%74%79%70%65%3d%22%73%75%62%6d%69%74%22%20%61%6c%74%3d%22%41%64%64%20%43%6f%6d%6d%65%6e%74%22%20%76%61%6c%75%65%3d%22%41%64%64%20%43%6f%6d%6d%65%6e%74%22%20%63%6c%61%73%73%3d%22%66%6f%72%6d%62%75%74%74%6f%6e%22%20%2f%3e %09%09%3c%62%72%20%2f%3e %3c%2f%66%6f%72%6d%3e
Home | PageTop | RSS2.0 | ATOM