Hello
I am trying to add an accordion block to a single page which is on dashboard. I am using Concrete CMS v9.0.
So I have added this to my controller:
$page = Page::getCurrentPage();
$block = BlockType::getByHandle('accordion');
//set block data (differs for each block type... following is an example for the 'content' type)
$data = array(
'title' => '<h3>title here</h3>',
'description' => '<p>description here</p>',
);
$page->addBlock($block, 'Main', $data);
And this to my view:
<?php
$a = new Area('Main');
$a->enableGridContainer();
$a->display($c);
?>
But it does not create the block as I wanted. It has just a empty div. What do I miss here? Any help is appreciated. Thanks.