By lum12 on
Hi all,
I'd like to put an IF statement into the node block for useing other block templates based on if the node has some terms in the taxonomy but I cannot get it working.
Here my temtative:
<div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
<?php print $picture ?>
<?php if ($page == 0): ?>
<h1 class="title"><a href="<?php print $node_url ?>"><?php print $title ?></a></h1>
<?php endif; ?>
<span class="submitted"><?php print $submitted ?></span>
<?php if (( (( $block->module == 'block' && $block->delta == 3 ) || ( $block->module == 'node' && $block->delta == '0' )) AND ($taxonomy->term == '14' ) )): ?><span class="taxonomy"><?php print $terms ?></span><?php endif; ?>
<div class="content"><?php print $content ?></div>
<?php if ($links): ?>
<div class="links">» <?php print $links ?></div>
<?php endif; ?>
</div>
the line is
<?php if (( (( $block->module == 'block' && $block->delta == 3 ) || ( $block->module == 'node' && $block->delta == '0' )) AND ($taxonomy->term == '14' ) )): ?>
what I can get it's just to change template for all node if I use in anyone the term "14"
my gola insead is to select just the node that have such term
some suggestions?
thanks a lot
luca
Comments
block.tpl.php OR node.tpl.php?
You say block (which implies block.tpl.php) but it looks like you are trying to display a node (node.tpl.php). You might want to review the pages under http://drupal.org/phptemplate for each of those to see the variables available. You example seems to try and use some of both.