Is it possible to display taxonomy terms above node title using this module?
Or some other way to get this, does anyone know?
It's not possible. The best way is to customize node.tpl.php and page.tpl.php
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...
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
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.
Automatically closed -- issue fixed for 2 weeks with no activity.
I get Drupal’s default style tags above the title and not this module’s style. I would like to see “Custom’s” style above the title. Please help.
It took a long time to finally come across this solution. It worked great. Thank you!
Comments
Comment #1
Eliza commentedOr some other way to get this, does anyone know?
Comment #2
rstamm commentedIt's not possible. The best way is to customize node.tpl.php and page.tpl.php
Comment #3
Eliza commentedWhen 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...
Comment #4
rstamm commentedfor a node teaser list page customize node.tpl.php.
Garland theme -> node.tpl.php
and for a single node page customize copy page.tpl.php to page-node.tpl.php
Garland theme -> page-node.tpl.php
and template.php
i don't know your theme but may be you have to customize CSS too
Comment #5
Eliza commentedGot just what I wanted! Thank you so much for detailed answer!
I also had to delete
in node.tpl.php to prevent terms from output twice.
Comment #7
mariner702 commentedI get Drupal’s default style tags above the title and not this module’s style. I would like to see “Custom’s” style above the title. Please help.
Comment #8
kbeck303 commentedIt took a long time to finally come across this solution. It worked great. Thank you!