How do I output a Composer Content block in a Page List?
Permalink
I've created a Page Type that has two Content Blocks in the Composer.
I would like my Page List to only display one of those blocks in the output. They are currently both in the "Main" Area in the Page. I seem to be able to output everything in Main using:
(based onhttp://www.concrete5.org/community/forums/customizing_c5/modify_pag...
But I can't figure out how to just output a specific block.
I could define specific Area's in the template for each block, but thought surely there would be a way I could do this programmatically.
Also - the Default/Output of my page type says the Block ID of the Content block is 304, but when I used $bl->getBlockID() in my code above, all the blockIDs were different (unique to each instance it seems) ?? So, why does the Output page show me a Block ID if I can't even use it??
[my brain hurts - I can't understand the API :(]
I would like my Page List to only display one of those blocks in the output. They are currently both in the "Main" Area in the Page. I seem to be able to output everything in Main using:
<?php foreach ($pages as $page) { $blocks = $cobj->getBlocks('Main'); foreach ($blocks as $bl) { if ($bl->btHandle == 'content') { echo $bl->getInstance()->content; } } } ?>
(based onhttp://www.concrete5.org/community/forums/customizing_c5/modify_pag...
But I can't figure out how to just output a specific block.
I could define specific Area's in the template for each block, but thought surely there would be a way I could do this programmatically.
Also - the Default/Output of my page type says the Block ID of the Content block is 304, but when I used $bl->getBlockID() in my code above, all the blockIDs were different (unique to each instance it seems) ?? So, why does the Output page show me a Block ID if I can't even use it??
[my brain hurts - I can't understand the API :(]