ใช้ Drupal ทำ WeBlog ส่วนตัว
และได้ใช้ Taxonomy เพื่อกำหนดหมวดหมู่ให้เนื้อหาแต่ละเรื่อง
ถ้าอยากให้ด้านข้างมี Block แสดงรายการหมวดหมู่ และแสดงจำนวนเรื่องทั้งหมดที่อยู่ในหมวดหมู่นั้น (จำนวน Node) ภายในเครื่องหมายวงเล็บ เหมือนกับ Sidebar ของ Wordpress
ตัวอย่าง
อยากทราบว่าจะสามารถใช้วิธีไหนได้บ้าง, หรือมี Module ตัวใดที่สามารถทำแบบนี้ได้บ้างครับ
ขอบคุณครับ
ผมค้นหาได้ Code มาได้ดังนี้
><?php $vid = 1; // Set the vid to the vocabulary id of the vocabulary you wish to list the terms from $items = array(); $terms = taxonomy_get_tree($vid); foreach ( $terms as $term ) { $count = db_result(db_query("SELECT COUNT(nid) FROM {term_node} WHERE tid = %d", $term->tid)); $items[] = l($term->name, "taxonomy/term/$term->tid") . " ($count)"; } if ( count($items) ) { print theme('item_list', $items); } ?></blockcode>
กระทู้เก่าๆ จะย้ายตามไปในภายหลัง ตอนนี้ปิดการโพสต์กระทู้ไว้ เหลือไว้เฉพาะอ้างอิงเท่านั้น
เคยใช้ SiteMenu อยู่พักนึง