Adding Blocks to Scrapbook in a Package9 users found helpful
So for example If I wanted to add a text block to the scrapbook from the package controller. Rather than the interface.
Or do I just add the block straight into the database using a MYSQL statement?
Thank you for any help
$helper = Loader::helper('concrete/scrapbook'); $sb=$helper->getGlobalScrapbookPage(); $cb = BlockType::getByHandle('content'); $data['content']='<p>Some Content</p>'; $block=$sb->addBlock($cb, "Global", $data); // optionally change the name of the block in the scrapbook $block->updateBlockName('MyBlockName', $force=1);
This of course assumes you're using a content block. Other block types will have different values for the data array. The best source of documentation would be in the controller for each block type.