Right now I have my front page set to use blogs. But I've notived there is no way to see what category (taxonomy) each of the blogs are in. Is there a way I can modify my theme to display this?

Also I don't know if anybody has done this but I'd love to see the ability to sort by date,taxonomy,modified(comments added)

THanks,

Keith

Comments

ax’s picture

even if you set your front page to use blogs (because index.php, for "site_frontpage" == "blog", calls blog_page(), which calls blog_page_last(), which calls node_view(), which calls theme("node"), which calls node() of your theme, which calls taxonomy_node_get_terms() to get the terms for this node and $this->links($terms) to show these terms. Only local images are allowed.). make sure you have terms assigned to your blog nodes, and that your custom theme includes something like the themes in the base distro to show the terms (if (function_exists("taxonomy_node_get_terms")) etc).

if you want to sort by date,taxonomy,modified(comments added), you have to fiddle with the ORDER BY in the sql query in blog_page_last() (and blog_page_user() and probably more). to sort by date, change the ORDER BY in $result = db_query_pager("SELECT nid FROM node WHERE type = 'blog' AND status = 1 ORDER BY nid DESC" ... to ORDER BY changed. taxonomy and modified are a little harder - check tracker.module (orders by comment or node last modified) and forum.module (forums are taxonomy terms) for examples.

shane’s picture

... this:

if (function_exists("taxonomy_node_get_terms")) {
   if ($terms = taxonomy_node_get_terms($node->nid)) {
      $taxlinks = array();
      foreach ($terms as $term) {
         $taxlinks[] = l($term->name, array("or" => $term->tid), "index");
      }
      $taxo = $this->links($taxlinks);
   }
} 

Then you can use $taxo somewhere in your output. This works within my themes node function to output a link to the related terms within that taxonomy group.

I forget where I got this chunk of code ... probably stripped out of someone else's theme.

You may have to modify the $node->nid part if Blogs uses a different contsruct? I've never used blogs, so not sure about that.

v/r

Shane