How can I hide all taxonomy links from under the node ?

cpuks - April 22, 2007 - 15:08

How can I do this ? I don't want showing taxonomy under every node.

Hiding taxonomy terms

nevets - April 22, 2007 - 15:34

If you never want the taxonomy terms to show you can edit your node.tpl.php file. You will find a section like

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

Remove that from node.tpl.php and no more terms.

If you only want to do it for a particular content type (or types), say page, you can copy node.tpl.php to node-type.tpl.php (ex: node-page.tpl.php) and remove the print of taxonomy terms from that file.

What do I edit in my node.tpl file

ssace - May 15, 2007 - 05:00

What do I edit in my node.tpl file. My file looks like this:

  <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>

Remove this line...

mactoph - May 15, 2007 - 05:24

Remove this line:

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

Thx

geoline - February 1, 2008 - 16:01

Hey nevets,

thanks for the tip. I was searching in the admin menu quite a time now to remove these links and couldn't find a solution.

Thanks, nevets that helped

khan_lko - February 4, 2008 - 19:41

Thanks, nevets that helped a lot. I was searching this from past few days.

For D6?

whealer - March 26, 2008 - 11:34

I looked in my node.tpl.php and the closest I found is:

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

I removed this but the taxonomy was still showing up... the full file reads:

<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?> clear-block">

<?php print $picture ?>

<?php if (!$page): ?>
  <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php endif; ?>

  <div class="meta">
  <?php if ($submitted): ?>
    <span class="submitted"><?php print $submitted ?></span>
  <?php endif; ?>

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

  <div class="content">
    <?php print $content ?>
  </div>

  <?php print $links; ?>
</div>

Any suggestions?

Did u removed ? <?php if

Sree - March 26, 2008 - 11:47

Did u removed ?

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

Is it in a perticular CCK or for all the content types?

All the content... I did not

whealer - March 26, 2008 - 22:27

All the content...

I did not remove the trailing </div> as that would have left an unclosed <div> but I did remove the other three lines...

Tks!

Got it... I had edited the

whealer - March 28, 2008 - 00:51

Got it... I had edited the file in the wrong directory...

Thank you

inkuyo - February 27, 2008 - 17:47

That is great. I did not need two titles in my page.

Can somebody bring this a

mr_dimsum - March 27, 2008 - 19:11

Can somebody bring this a step further? I would like to display taxonomy terms, but only a particular group. Removing all terms was the first step, but how about do I go specifying the terms to display?

 
 

Drupal is a registered trademark of Dries Buytaert.