Creating a container

Hi, ive been looking through the documentation and cheatsheets but i can’t find a way to programmatically add containers…anyone got any idea how, i was thinking something like the following should be possible:

$pTemplate = PageTemplate::getByHandle(‘three_column’);
if(!$pTemplate) {
PageTemplate::add(‘three_column’, t(‘Three Column’), ‘three_column.png’, $pkg = null);
}

There are 2 files in the code I can find where a new container is created, doesn’t look quite as simple as some other things.

If you have a package it might be easier to just do it using the CIF stuff like they do in the Atomik

https://github.com/concretecms/concretecms/blob/9.1.0/concrete/config/install/packages/atomik_full/content.xml (around line 447)

2 Likes

Thx hutman, that really helps!