Greetings from Copenhagen + theming of taxonomies

Events happening in the community are now at Drupal community events on www.drupal.org.
johsw@drupal.org's picture

My name is Johannes Wehner, and I'm the lead hacker at Information.

I'm so happy to see how many have signed up for this group.

Right now one of our goals is to figure out how we want to filter our content. So far we plan to do three or four categories PER article: 1: Section (international, arts, opinion etc.) 2: Subject (Film noir, War in Iraq, etc), 3) Genre (Editorial, feature, review etc.), and 4: Freetags.

We'll use these tags to make different sections and subsections. But we don’t want to display all four taxonomies the same place. We would like to display Section in the top, , Subject and Genre by the header and freetags in the bottom of the article.

Is the right way to do this to hack the node template?

I guess I would filter the categories by hardcoding the template to show some $term->vids in the bottom and some in the top. Or do you have another idea on how to divide the content into sections?

Comments

node.tpl.php and template.php

yelvington's picture

You probably need to do some work in template.php to make appropriately named variables available, then create a custom node.tpl.php to generate $content formatted the way you want. The default is to throw all the terms into one big bucket, and that's not good.

node.tpl.php

johsw@drupal.org's picture

In our current setup I've got this code in node.tpl.php

<?php

$tempTaxes
= $node->taxonomy;
$otherTaxonomies = '';
foreach(
$tempTaxes as $var => $value) {

       
$term = $tempTaxes[$var];
      if (
$term->vid==6) {
       
              
$blogLink = l($term->name, 'taxonomy/term/'.$term->tid, array('title' => $term->description) ) . ' ';

      } else {
      
          
$otherTaxonomies .= l($term->name, 'taxonomy/term/'.$term->tid, array('title' => $term->description) ) . ' ';
       }
}


?>

Would you have don this in template.php?

Best
/Johs.

Newspapers on Drupal

Group organizers

Group categories

Topics - Newspaper on Drupal

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: