Quick Overview: I am trying to return results from a specific set of static blocks to a phtml file (which is then called on from a
You are not printing block inside foreach loop. Solution: move } parenthesis to the end of pasted code
$blockNum = 1;
foreach($collection as $key => $value){
$_blockId = $this->getIdentifier();
$block_ID = $_blockId . $blockNum;
echo "Key: " . $key . " - " . "Block ID: " . $block_ID . "<br />";
$blockNum++;
$_block = $this->getLayout()->createBlock('cms/block')->setBlockId($block_ID);
if ($_block) : ?>
<div class="block block-testimonial">
<div class="block-title">
<strong><?php echo $this->getTitle(); ?></strong>
</div>
<div class="block-content">
<?php echo $_block->toHtml(); ?>
</div>
<?php
endif;
}
I think that on Magento Connect are some Testimonial Modules, that are doing job you want. On the other hand, if you are looking for 'simple' solution or if you are trying to play with Magento, is this approach ok.