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 . "
";
$blockNum++;
$_block = $this->getLayout()->createBlock('cms/block')->setBlockId($block_ID);
if ($_block) : ?>
getTitle(); ?>
toHtml(); ?>
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.
讨论(0)