Terms above title

Eliza - July 4, 2009 - 18:37
Project:Term Display
Version:6.x-1.1
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Is it possible to display taxonomy terms above node title using this module?

#1

Eliza - July 5, 2009 - 13:01

Or some other way to get this, does anyone know?

#2

Ralf - July 7, 2009 - 07:14

It's not possible. The best way is to customize node.tpl.php and page.tpl.php

#3

Eliza - July 7, 2009 - 10:26

When I try to put terms above title in node.tpl.php, terms just disappear. And what to do with page.tpl.php is beyond my mind...

#4

Ralf - July 8, 2009 - 00:23
Status:active» fixed

for a node teaser list page customize node.tpl.php.

Garland theme -> node.tpl.php

...
<?php if ($page == 0): ?>
  <div class="clear-block">
    <div class="meta">
    <?php if ($taxonomy): ?>
      <div class="terms"><?php print $terms ?></div>
    <?php endif;?>
    </div>
  </div>

  <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php endif; ?>
...

and for a single node page customize copy page.tpl.php to page-node.tpl.php

Garland theme -> page-node.tpl.php

...
<?php print $breadcrumb; ?>
<?php if ($mission): print '<div id="mission">'. $mission .'</div>'; endif; ?>

<?php if ($terms): print '<div id="terms">'. $terms .'</div>'; endif; ?>

<?php if ($tabs): print '<div id="tabs-wrapper" class="clear-block">'; endif; ?>
<?php if ($title): print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; endif; ?>
...

and template.php

function phptemplate_preprocess_page(&$vars) {
...

  foreach (taxonomy_node_get_terms($vars['node']) as $term) {
    $terms[] = l($term->name, 'taxonomy/term/'. $term->tid);
  }
  $vars['terms'] = theme('item_list', $terms);

...
}

i don't know your theme but may be you have to customize CSS too

#5

Eliza - July 8, 2009 - 04:08

Got just what I wanted! Thank you so much for detailed answer!
I also had to delete

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

in node.tpl.php to prevent terms from output twice.

#6

System Message - July 22, 2009 - 04:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.