Hello, I want to create a custom bloc type set (like ‘Basic’, ‘Navigation’, ‘Form’, …) in order to group all my custom blocks together.
I created a package for my theme and created the page-theme.php with the code below, but it doesn’t work.
Any ideas ?
Is the page-theme.php the best choice to execute this code ?
Is there a method to remove a bloc type set programmatically ?
<?php
namespace Concrete\Package\Sfgs;
defined('C5_EXECUTE') or die('Access Denied.');
use \Concrete\Core\Package\Package;
use BlockTypeSet;
class Controller extends Package
{
... code with the package handle, version, description, ...
public function makeMyBlockSet($handle,$name){
if (!BlockTypeSet::getByHandle($handle)) {
BlockTypeSet::add($handle, $name, $pkg);
}
}
public function install()
{
parent::install();
$this->makeMyBlockSet('myblocset_handle','My Block Set');
$this->installContentFile('install/theme.xml');
$this->installContentFile('install/block_types.xml');
}
public function upgrade()
{
parent::upgrade();
$this->installContentFile('install/theme.xml');
$this->installContentFile('install/block_types.xml');
}
}