I have been searching all over the place for some help on this.

I currently have my tags displaying for each node like such: tag,tag,tag

Now I would like them to display a little cleaner and more appealing to my visitors. So what I would like to do is have them display like such: tag \ tag \ tag

Now from what I have read, I need to target the field API? and use a preprocess function to alter what the array is spiting out? Please correct me if I am wrong.

This seems like an easy task to complete but I just can't seem to find a solution.

Thanks in advance

1 Answer 1


Indeed a preprocess function is what you're looking for, I suspect in D7 this will help:

function MYTHEME_preprocess_html(&$variables) {
if(arg(0)=='node' && is_numeric(arg(1))) {
    $node = node_load(arg(1));
    $results = taxonomy_node_get_terms($node);
    if(is_array($results)) {
        foreach ($results as $item) {

In terms of D6, node-taxonomy.tpl.php and page-taxonomy-term.tpl.php should put you on the right path.

  • Thanks for helping me out... but in your example I don't see here the \ symbol comes into play... i'm still a little lost and yes I am in D7. Again thanks for the response!
    – TikaL13
    Commented Sep 27, 2011 at 4:10
  • 1
    The sample I provided is incomplete PHP code. The addition of the '/' character would be in the foreach loop as you see fit. $item is would each of the terms to something like: $categories .= $item .' / '; Perhaps you might want to investigate basic PHP programming concepts first? It will be essential to customizing Drupal.
    – DeeZone
    Commented Sep 27, 2011 at 14:09
  • @DeeZone... great thanks for the added explanation.
    – TikaL13
    Commented Sep 27, 2011 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.