Comments (5)
Correct the sandbox is not yet completed, the path must be 'SonataPageBundle::layout.html.twig' and not NULL in your query
from sonatapagebundle.
I create some command for default template:
namespace Sonata\PageBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\Output;
use Application\Sonata\PageBundle\Entity\Template;
class CreateTemplatesCommand extends ContainerAwareCommand
{
public function configure()
{
$this->setName('sonata:page:create-templates');
$this->setDescription('Create a default templates');
}
public function execute(InputInterface $input, OutputInterface $output)
{
$em = $this->getContainer()->get('doctrine')->getEntityManager();
$pageManager = $this->getContainer()->get('sonata.page.manager.page');
$template = $pageManager->getDefaultTemplate();
if (! $template) {
$template = new Template();
$template->setName('default');
$template->setEnabled(true);
$template->setPath('SonataPageBundle::layout.html.twig');
$em->persist($template);
$em->flush();
$output->writeln(' Creating default template !');
}
$output->writeln(' OK !');
}
}
from sonatapagebundle.
you should really learn how to create PR, github makes the workflow very easier, see http://help.github.com/send-pull-requests/
from sonatapagebundle.
btw I am removing the template table, as it's not a data that should be handled by the end user. so this logic is going to change to a configuration :
sonata_page:
templates:
- { default: true, path: 'SonataPageBundle::layout.html.twig', name: default }
from sonatapagebundle.
from sonatapagebundle.
Related Issues (20)
- [Doc][Bug] It's throwing an exception when we are decorating PageAdmin HOT 13
- [BUG] Composer (Compose page blocks) gives incorrect position to new created block after deleting few of them HOT 2
- [4.x] doctrine extension version is wrong? HOT 2
- [4.x] Recipe is broken? HOT 6
- Page type filter not working HOT 5
- CmsPageRouter not working
- The SiteAdmin doesn't honor admin option "list_action_button_content" HOT 5
- CmsManagerSelector.isEditor always returns false HOT 2
- Remove Twig form_themes HOT 1
- Removing a page doesn't work from the edit route (works using batch delete) HOT 6
- Switch cocur/slugify to symfony/string HOT 3
- Fix pipeline TransformerInterface HOT 15
- [Model/Page] Remove nullable return for methods that is required HOT 3
- Web profiler not working after runtime added HOT 14
- Decorate `BlockAdmin`, `SnapshotAdmin` and `CreateSnapshotService` HOT 6
- View page button in PageAdmin with multisite HOT 3
- Unable update deprecated RequestFactory::createFromGlobals('host_with_path'); in index.php HOT 16
- Undefined property SonataPageBlock::$lazyObjectState HOT 21
- Add sonata_page twig extension HOT 4
- A circular reference has been detected when serializing the object of class when saving snapshot HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonatapagebundle.