By andrew_hoffi on
I need to setup a sequential ID on each block E.g. ID=Block1 and then Block2, Block3 as their displayed. I was using the visibility attribute to do this, but it doesnt seem to work the same way when I have conditions placed on the display of individual blocks. I.e it seems to display the value 1 for all blocks.
Here's what I've got:
<?php
if ( $block->region == "CONTENT"){
?>
<div class="slide" id="slide<?php print $block->visibility ?>">
<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="clear-block block block-<?php print $block->module ?>">
<div class="content">
<?php if (!empty($block->subject)): ?><h2><?php print $block->subject ?></h2><?php endif;?>
<?php print $block->content ?>
</div>
</div>
</div>
<?php
}
?>
I've taken a look inside the theme_blocks($region), but it doesnt give a running count of the blocks as their displayed. Any help would be appreciated.
Comments
See:
See: http://api.drupal.org/api/drupal/modules--system--block.tpl.php/6, $block_id.
Brilliant thanks so much I've
Brilliant thanks so much I've been gazing at it for the last 30mins or so.
Thanks
Andrew
-------------------
www.hoffi.com