} // Home layout if (null === ($layout = $em->find('BackBee\\Site\\Layout', md5('defaultlayout-' . $label)))) { $layout = new \BackBee\Site\Layout(md5('defaultlayout-' . $label)); $layout->setData('{"templateLayouts":[{"title":"Top column","layoutSize":{"height":300,"width":false},"gridSizeInfos":{"colWidth":60,"gutterWidth":20},"id":"Layout__1332943638139_1","layoutClass":"bb4ResizableLayout","animateResize":false,"showTitle":false,"target":"#bb5-mainLayoutRow","resizable":true,"useGridSize":true,"gridSize":5,"gridStep":100,"gridClassPrefix":"span","selectedClass":"bb5-layout-selected","position":"none","height":800,"defaultContainer":"#bb5-mainLayoutRow","layoutManager":[],"mainZone":true,"accept":[],"maxentry":"0","defaultClassContent":null},{"title":"Main column","layoutSize":{"height":800,"width":false},"gridSizeInfos":{"colWidth":60,"gutterWidth":20},"id":"Layout__1383430750637_1","layoutClass":"bb5-resizableLayout","animateResize":false,"showTitle":false,"target":"#bb5-mainLayoutRow","resizable":true,"useGridSize":true,"gridSize":2,"gridStep":100,"gridClassPrefix":"span","selectedClass":"bb5-layout-selected","alphaClass":"alpha","omegaClass":"omega","typeClass":"hChild","clearAfter":1,"height":800,"defaultContainer":"#bb5-mainLayoutRow","layoutManager":[],"mainZone":false,"accept":[],"maxentry":0,"defaultClassContent":null},{"title": "Nouvelle zone","layoutSize": {"height": 800,"width": false},"gridSizeInfos": {"colWidth": 60,"gutterWidth": 20},"id": "Layout__1383430750640_1","layoutClass": "bb5-resizableLayout","animateResize": false,"showTitle": false,"target": "#bb5-mainLayoutRow","resizable": true,"useGridSize": true,"gridSize": 2,"gridStep": 100,"gridClassPrefix": "span","selectedClass": "bb5-layout-selected","alphaClass": "alpha","omegaClass": "omega","typeClass": "hChild","clearAfter": 1,"height": 800,"defaultContainer": "#bb5-mainLayoutRow","layoutManager": [],"mainZone": false,"accept": [],"maxentry": 0,"defaultClassContent": null}]}')->setLabel('Home')->setPath('Home.twig')->setPicPath($layout->getUid() . '.png')->setSite($site); $em->persist($layout); } // Article's layout if (null === ($articleLayout = $em->find('BackBee\\Site\\Layout', md5('articlelayout-' . $label)))) { $articleLayout = new BackBee\Site\Layout(md5('articlelayout-' . $label)); $articleLayout->setData('{"templateLayouts":[{"title":"Main Column","layoutSize":{"height":300,"width":false},"gridSizeInfos":{"colWidth":60,"gutterWidth":20},"id":"Layout__1332943638139_1","layoutClass":"bb4ResizableLayout","animateResize":false,"showTitle":false,"target":"#bb5-mainLayoutRow","resizable":true,"useGridSize":true,"gridSize":5,"gridStep":100,"gridClassPrefix":"span","selectedClass":"bb5-layout-selected","position":"none","height":800,"defaultContainer":"#bb5-mainLayoutRow","layoutManager":[],"mainZone":true,"accept":["Article\\\\Article"],"maxentry":"0","defaultClassContent":"Article\\\\Article"},{"title":"Right Pane","layoutSize":{"height":800,"width":false},"gridSizeInfos":{"colWidth":60,"gutterWidth":20},"id":"Layout__1383430750637_1","layoutClass":"bb5-resizableLayout","animateResize":false,"showTitle":false,"target":"#bb5-mainLayoutRow","resizable":true,"useGridSize":true,"gridSize":2,"gridStep":100,"gridClassPrefix":"span","selectedClass":"bb5-layout-selected","alphaClass":"alpha","omegaClass":"omega","typeClass":"hChild","clearAfter":1,"height":800,"defaultContainer":"#bb5-mainLayoutRow","layoutManager":[],"mainZone":false,"accept":[],"maxentry":0,"defaultClassContent":null}]}')->setLabel('Article')->setPicPath($articleLayout->getUid() . '.png')->setSite($site); $em->persist($articleLayout); } // Category's layout if (null === ($categoryLayout = $em->find('BackBee\\Site\\Layout', md5('categorylayout-' . $label)))) { $categoryLayout = new BackBee\Site\Layout(md5('categorylayout-' . $label)); $categoryLayout->setData('{"templateLayouts":[{"title":"Main column","layoutSize":{"height":300,"width":false},"gridSizeInfos":{"colWidth":60,"gutterWidth":20},"id":"Layout__1332943638139_1","layoutClass":"bb4ResizableLayout","animateResize":false,"showTitle":false,"target":"#bb5-mainLayoutRow","resizable":true,"useGridSize":true,"gridSize":5,"gridStep":100,"gridClassPrefix":"span","selectedClass":"bb5-layout-selected","position":"none","height":800,"defaultContainer":"#bb5-mainLayoutRow","layoutManager":[],"mainZone":true,"accept":["Article\\\\ArticleContainer"],"maxentry":"0","defaultClassContent":"Article\\\\ArticleContainer"},{"title":"Second column","layoutSize":{"height":800,"width":false},"gridSizeInfos":{"colWidth":60,"gutterWidth":20},"id":"Layout__1383430750637_1","layoutClass":"bb5-resizableLayout","animateResize":false,"showTitle":false,"target":"#bb5-mainLayoutRow","resizable":true,"useGridSize":true,"gridSize":2,"gridStep":100,"gridClassPrefix":"span","selectedClass":"bb5-layout-selected","alphaClass":"alpha","omegaClass":"omega","typeClass":"hChild","clearAfter":1,"height":800,"defaultContainer":"#bb5-mainLayoutRow","layoutManager":[],"mainZone":false,"accept":[],"maxentry":0,"defaultClassContent":null},{"title": "Nouvelle zone","layoutSize": {"height": 800,"width": false},"gridSizeInfos": {"colWidth": 60,"gutterWidth": 20},"id": "Layout__1383430750640_1","layoutClass": "bb5-resizableLayout","animateResize": false,"showTitle": false,"target": "#bb5-mainLayoutRow","resizable": true,"useGridSize": true,"gridSize": 2,"gridStep": 100,"gridClassPrefix": "span","selectedClass": "bb5-layout-selected","alphaClass": "alpha","omegaClass": "omega","typeClass": "hChild","clearAfter": 1,"height": 800,"defaultContainer": "#bb5-mainLayoutRow","layoutManager": [],"mainZone": false,"accept": [],"maxentry": 0,"defaultClassContent": null}]}')->setLabel('Category')->setPicPath($categoryLayout->getUid() . '.png')->setSite($site); $em->persist($categoryLayout); } // Creating site root page if (null === ($root = $em->find('BackBee\\NestedNode\\Page', md5('root-' . $label)))) { $pagebuilder->setUid(md5('root-' . $label))->setTitle('Home')->setLayout($layout)->setSite($site)->setUrl('/')->putOnlineAndHidden(); $page = $pagebuilder->getPage(); $em->persist($page); $em->flush($page); $blockDemo = new \BackBee\ClassContent\BlockDemo(); $blockDemo->setState(\BackBee\ClassContent\AbstractClassContent::STATE_NORMAL); $blockDemo->setRevision(1); $homeContainer = new \BackBee\ClassContent\Home\HomeContainer(); $homeContainer->setState(\BackBee\ClassContent\AbstractClassContent::STATE_NORMAL); $homeContainer->setRevision(1);
/** * Create new home layout * * @param \BackBee\Site\Site $site Site object * * @return \BackBee\Site\Layout */ private function createHomeLayout($site) { $layout = new \BackBee\Site\Layout(md5('defaultlayout-' . $site->getLabel())); $layout->setData('{"templateLayouts":[{"title":"Top column","layoutSize":{"height":300,"width":false},"gridSizeInfos":{"colWidth":60,"gutterWidth":20},"id":"Layout__1332943638139_1","layoutClass":"bb4ResizableLayout","animateResize":false,"showTitle":false,"target":"#bb5-mainLayoutRow","resizable":true,"useGridSize":true,"gridSize":5,"gridStep":100,"gridClassPrefix":"span","selectedClass":"bb5-layout-selected","position":"none","height":800,"defaultContainer":"#bb5-mainLayoutRow","layoutManager":[],"mainZone":true,"accept":[],"maxentry":"0","defaultClassContent":null},{"title":"Main column","layoutSize":{"height":800,"width":false},"gridSizeInfos":{"colWidth":60,"gutterWidth":20},"id":"Layout__1383430750637_1","layoutClass":"bb5-resizableLayout","animateResize":false,"showTitle":false,"target":"#bb5-mainLayoutRow","resizable":true,"useGridSize":true,"gridSize":2,"gridStep":100,"gridClassPrefix":"span","selectedClass":"bb5-layout-selected","alphaClass":"alpha","omegaClass":"omega","typeClass":"hChild","clearAfter":1,"height":800,"defaultContainer":"#bb5-mainLayoutRow","layoutManager":[],"mainZone":false,"accept":[],"maxentry":0,"defaultClassContent":null},{"title": "Nouvelle zone","layoutSize": {"height": 800,"width": false},"gridSizeInfos": {"colWidth": 60,"gutterWidth": 20},"id": "Layout__1383430750640_1","layoutClass": "bb5-resizableLayout","animateResize": false,"showTitle": false,"target": "#bb5-mainLayoutRow","resizable": true,"useGridSize": true,"gridSize": 2,"gridStep": 100,"gridClassPrefix": "span","selectedClass": "bb5-layout-selected","alphaClass": "alpha","omegaClass": "omega","typeClass": "hChild","clearAfter": 1,"height": 800,"defaultContainer": "#bb5-mainLayoutRow","layoutManager": [],"mainZone": false,"accept": [],"maxentry": 0,"defaultClassContent": null}]}')->setLabel('Home')->setPath('Home.twig')->setPicPath($layout->getUid() . '.png')->setSite($site); $this->entyMgr->persist($layout); return $layout; }