Taxonomy terms are always listed at the bottom of the nodes I make, (as a link that category) - However, I don't want them to be there, as it adds another thing to the page and distracts from the content of the node.

How can I remove them from the bottom like that?

Thanks!

Comments

Etc. Incarnate’s picture

*bumps* =)

nodecode’s picture

I know this is old, but for anyone who cares, if you just want to hide the terms you can add this line to your CSS file of a Zen-based theme (and probably other themes as well)...

.node .terms{
display: none;
}
softprayog’s picture

Turning of display of class field-type-taxonomy-term-reference removes the taxonomy reference terms at the end of posts.

.field-type-taxonomy-term-reference {
display: none;
}

Drupalace-1’s picture

Or so I'm told: In your theme's node.tpl.php file, find and remove print $terms

(Or don't remove it; you might want it back later. Safer to just comment it out.)

Does anybody know some other method?

--------
A site by, of, and for the Drupal newbie: http://www.drupalace.com

Etc. Incarnate’s picture

*blinks* Honestly? Its that simple?

*goes to try it out*

Etc. Incarnate’s picture

No luck.

Commented it out as suggested, and uploaded to site again. But when I view the nodes, still the same thing.

Is there something I have to to do refresh/bring it to drupals attention? I don't have caching enabled, so thats not it...

Thanks.

Etc. Incarnate’s picture

Oops!

My mistake - I was putting it in the wrong theme folder. Problem solved, thanks! =D

One other question - I will eventually have another content type that I would like to have the taxonomy links at the bottom - Is there a way to make node.tpl's specific to a certain content type?

Thanks!

AndiS’s picture

You can make specific templates for different content types simply by putting the content type name in the filename of the node template, like node-contenttype.tpl.php

more info here: http://drupal.org/node/17565

joachim’s picture

You can also switch by the value of $node->type within the template file, if using several templates is overkill.

David.W’s picture

Thanks

dan6684’s picture

I am having the same problems :(

can anyone kindly answer?

thanks a LOT

stellar’s picture

Can this be done with Contemplate?

bergco’s picture

I've just tried, but it doesn't work for me. Even when I delete the body in the template, the last line was still there.

nicholasbarcomb’s picture

This is a pretty standard node.tpl.php page (this one is from Bluemarine, Drupal 5)

  <div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
    <?php if ($picture) {
      print $picture;
    }?>
    <?php if ($page == 0) { ?><h2 class="title"><a href="<?php print $node_url?>"><?php print $title?></a></h2><?php }; ?>
    <span class="submitted"><?php print $submitted?></span>
    <span class="taxonomy"><?php print $terms?></span>
    <div class="content"><?php print $content?></div>
    <?php if ($links) { ?><div class="links">&raquo; <?php print $links?></div><?php }; ?>
  </div>

To delete taxonomy and links from all node just delete:

    <span class="taxonomy"><?php print $terms?></span>

and

    <?php if ($links) { ?><div class="links">&raquo; <?php print $links?></div><?php }; ?>

To just hide them from being seen by the browser and keeping them in your php file surround the code you want hidden with theses <!-- your code -->

Hope this helps
-Nick

gost_’s picture

you can also remove a specific vocabulary/term link with theme overrides

and check out this module Taxonomy Hide:

http://drupal.org/project/taxonomy_hide

ressa’s picture

It works just perfectly, hiding the vocabulary terms in node views, either by vocabulary or by node type.

alan mccoll’s picture

I put some custom code in a node--custom_content_type.tpl.php file to provide a graphic "back button" to the bottom of the node view which links back to the view from which you just came. When you clicked the taxonomy term link, it provided an html list of all content types with that term. The last item in each listing of custom_content_type was a graphic "back button", yuck!
Since I didn't have any use for the taxomony link, at least not that I can think of right now, I used this CSS code to hide it in Drupal 7;

/* This will hide display of taxonomy links and their label in node view ======== */
.article-content .field-type-taxonomy-term-reference ul, .article-content .field-type-taxonomy-term-reference {
display: none;
}

I don't think these classes are unique to my theme, which is a sub-theme of adaptivethemes. I just used Firefox's Firebug plugin to find the appropriate classes.

Cablestein’s picture

In Drupal 7, you should do it this way:
"Admin/Structure/Content Type/Manage Display/"
Here you can control the visibility of BOTH the label and links.

FYI I could not find where term links are rendered in either page.tpl.php or node.tpl.php... I think it occurs in a deeper file.

Also, I really disagree with using CSS hiding as a solution.

awwylach’s picture

I totally agree, just facing the same problem to try to switch off the output of the taxonomy terms (because I relocated the output of them to another place in the display). An simple unset() is not possible. Maybe in the future there is an way to control this inside a hook? For now I use the crappy CSS solution.

LoMo’s picture

In D7 it's easy to control the display. Just go to your content type "display" and set the label and display "format" for your term reference field(s) to "<hidden>". It's very simple. And you can do that just for teasers, for full nodes, or for RSS feeds, etc.

See you at the Drupalcon!

Anonymous’s picture

I have a field field_category which is a taxonomy term.
To hide it from showing just hide it before the render($content) is called:

// in my case:
hide($content['field_category']);