Posted by Eliza on July 4, 2009 at 6:37pm
Jump to:
| Project: | Term Display |
| Version: | 6.x-1.1 |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | <? print $terms; ?>, page.tpl.php, taxonomy terms |
Issue Summary
Is it possible to display taxonomy terms above node title using this module?
Comments
#1
Or some other way to get this, does anyone know?
#2
It's not possible. The best way is to customize node.tpl.php and page.tpl.php
#3
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
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
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
Automatically closed -- issue fixed for 2 weeks with no activity.
#7
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.
#8
It took a long time to finally come across this solution. It worked great. Thank you!