Greetings, all!

I want to create a front page that is not the general list of "promoted to front page" items, but instead is a (partial) list of my taxonomy. When the user clicks on the appropriate taxonomy link, he sees a list of the pages marked with that term.

What configuration, module, or PHP code do I need to add to make this happen?

Comments

thepaul’s picture

Have a look at the 'views' module. Possibly 'pannels' as well depending on how you want your front page layout to look.

jwatte’s picture

Sorry, I should have been more specific:
I'm using Drupal 6.0.
Googling for "Views Drupal 6.0" mostly finds posts about people kvetching that it's not available for 6.0...

arh1’s picture

you definitely want to use Views for this, though. unfortunately Drupal 6 was just released a few days ago and most modules have not been ported yet. Views is one of the 3 biggest contributed modules, though and under very active development -- it should be ported shortly. (of course, you can always check in with the Views developers to see if they'd like a hand!)

jwatte’s picture

Here's what I came up with. I can't really find a good tutorial to "writing PHP node code" though -- it's all based on themese or blocks.

(here's hoping "CODE" tags will magically mean I can post the code with tags...)

<br />
<?php

// This could be done as a single query, order by 
// vocabulary. I'm too lazy, though.
$r = db_query("SELECT v.vid, v.name FROM {vocabulary} v WHERE v.name != 'Forums' ORDER BY v.name");

while ($q = db_fetch_object($r)) {
  print("<br class='sectiondiv'/>\n");
  $hdr = array(array('data' => t($q->name), 'colspan' => 2), array('data' => t('Count')));
  $rows = array();
  $s = db_query("SELECT t.tid AS tid, t.name AS name, t.description AS description, count(*) AS count FROM {term_data} t, {term_node} n WHERE n.tid = t.tid AND t.vid = %d GROUP BY t.tid ORDER BY t.name ASC", $q->vid);
  while ($i = db_fetch_object($s)) {
    $rows[] = array(array('data' => l(t($i->name), "taxonomy/term/".$i->tid)), array('data' => t($i->description)),array('data' => "".$i->count));
  }
  print(theme('table', $hdr, $rows));
}
  print("<br class='sectiondiv'/>\n");

print(theme('links', array(array('title' => t("Cronological Order"), 'href' => "node"))));
?>