Can I hide the taxonomy term links that appear in nodes or node listings?

Drupalace - January 11, 2007 - 05:54

Time again for Drupal 101 "I thought I knew how to do this, but I guess not" newbie-ness.

Nodes and node listings display a horizontal list of the node's terminology terms (following the "Submitted by..." text, or wherever the theme dictates).

Editing the PHP code is one way to turn off those links, but isn't there a way within the Drupal settings? I thought there was, but poking around user settings, content types settings, theme settings, and so on is turning up nothing...

The answer may be a simple "no, you can't". Sorry to ask what must have been asked many times before, but a forum search for "hide term links" and similar attempts isn't getting me anywhere.

Thank you!

I think not

MikeyLikesIt - January 11, 2007 - 07:43

It would be nice if that were in the adminisitrations screens, but the only way that I know of is to edit the theme functions and files for the appropriate displays.

I also would like to know if

keenan83 - March 21, 2007 - 14:26

I also would like to know if there is another way of doing this without altering the code myself.

I don't know a way through the Drupal interface, but..

jastraat - March 21, 2007 - 15:18

I don't know a way to change the display of terms through the Drupal interface, but you can hide them very simply in the theme either using CSS or making a tiny alteration to the node.tpl.php file. If you're working from the Garland theme, make a copy of the theme, place it in your sites/all/themes folder and rename it. If you already are using a contributed or customized theme, you can just edit that. The code that creates the term links is in the node.tpl.php file. Comment out the following lines as demonstrated below:

<!--
<?php if ($taxonomy): ?>
      <div class="terms"><?php print $terms ?></div>
<?php endif;?>
-->

Alternatively, you can edit the style.css file and add the following:

.terms {
    display: none;
}

jastraat, that looks like a

Drupalace - June 27, 2007 - 02:56

jastraat, that looks like a great – and simple – solution. An admin-based solution would be an ideal addition to Drupal in the future, but for now, I appreciate the CSS how-to. Thanks!

--------
One Drupal non-guru's slow road to enlightenment: http://www.drupalace.com

Yes, this should really be

morty - June 1, 2007 - 15:55

Yes, this should really be possible to configure through the administration interface.

That worked very well for

mboudey - June 13, 2007 - 04:06

That worked very well for me.
Thanks.
Michaël

Hide taxonomy terms with inline css; a block based approach

steveoliver - June 28, 2008 - 18:21

Create a new block (Input format: Full HTML) with the following code:

<style type="text/css">
<!--
.terms { display:none; }
-->
</style>

Advantages:

  1. You don't have to hack a theme (in case it is shared with other sites in a multisite environment.
  2. You can enable/disable the terms-hiding css code on any node or section of your site.

--
Steve Oliver
Circatree Design
www.circatreedesign.com

hide it dynamically?

sandspyderx - August 2, 2008 - 14:20

Hi

Maybe using the taxonomy hide module helps:

http://drupal.org/project/taxonomy_hide

regards from Namibia

 
 

Drupal is a registered trademark of Dries Buytaert.