19th Street Design is now Greg Willis Industries!

Head on over to the new website for updated information and the new contact form. I'll keep this old website up until the summer of 2012. Make sure you update your links to the new site. Thanks!

Drupal Theming

Adding a Separator in Drupal Taxonomy Terms

Out of the box the Zen theme displays the taxonomy terms of a node as inline links with no separators. If you want some text dividing the terms, try the following:

In your theme's node.tpl.php file there should be some code that looks like
<?php print t(' in ') . $terms; ?>

Replace that code with

<?php  
  
foreach($node->taxonomy as $tid => $taxo)
  
$taxo_links[] = l($taxo->name,"taxonomy/term/$taxo->tid", array('title' => $taxo->name));
   print
t('<strong>Tags:</strong> ') . implode('  |  ',$taxo_links);
?>

In this example I've used the pipe character (|) as the separator in this section implode('  |  ',$taxo_links). Just replace that '|' with the character of your choice and you're good.

Found this at drupal.org Theming taxonomy terms.

Tags: Drupal Theming | PHP Code

Drupal Menu IDs

One of the first things I do when customizing a Drupal install is to add CSS IDs to the menu items. At some point you're usually going to have to do something with the menu items, so it's nice to have the handles already in place for the grabbing. You drop the following code into your template.php file.

Tags: Drupal Theming | PHP Code
Syndicate content