0

I've installed CreateBundle and already got BlockBundle running. The plain text editor works fine, but I'm having trouble to get ckeditor running.

This is what I configured for CreateBundle:

cmf_create:
    auto_mapping: true
    editor_base_path: /bundles/cmfcreate/vendor/ckeditor/
    fixed_toolbar: true

This is the template I'm rendering:

{% include "CmfCreateBundle::includecssfiles.html.twig" %}
{{ locale_switcher() }}

{{ sonata_block_render({
    'name': '/' ~ app.request.locale ~ '/TestBlockDE1'
}) }}


{% render(controller(
    "cmf_create.jsloader.controller:includeJSFilesAction",
    {"editor": "ckeditor", "_locale": app.request.locale }
)) %}

TestBlockDE1 is the name of the SimpleBlock where the schema:headline shall be plain_text editable (which works) and the schema:text shall be editable through CKEditor like in the sandbox example.

This is my composer.json file:

{
    "name" : "symfony/framework-standard-edition",
    "description" : "The \"Symfony Standard Edition\" distribution",
    "type" : "project",
    "keywords" : [],
    "license" : [
        "MIT"
    ],
    "require" : {
        "doctrine/doctrine-fixtures-bundle" : "dev-master",
        "jackalope/jackalope-doctrine-dbal" : "dev-master",
        "friendsofsymfony/user-bundle" : "*",
        "symfony/swiftmailer-bundle" : "2.3.*",
        "sonata-project/cache-bundle" : "dev-master",
        "doctrine/orm" : ">=2.2.3,<2.4-dev",
        "sonata-project/user-bundle" : "dev-master",
        "friendsofsymfony/rest-bundle" : "1.0.*@dev",
        "symfony-cmf/create-bundle" : "1.0.*@dev",
        "lunetics/locale-bundle" : "dev-master",
        "twig/extensions" : "1.0.*",
        "php" : ">=5.3.3",
        "symfony-cmf/symfony-cmf" : "dev-master",
        "symfony/monolog-bundle" : "2.3.*",
        "symfony-cmf/media-bundle" : "1.0.*@dev",
        "sensio/distribution-bundle" : "2.3.*",
        "symfony/symfony" : "2.3.*",
        "doctrine/phpcr-bundle" : "1.0.0",
        "sonata-project/doctrine-orm-admin-bundle" : "2.*",
        "sonata-project/easy-extends-bundle" : "dev-master",
        "doctrine/phpcr-odm" : "1.0.0",
        "symfony/assetic-bundle" : "2.3.*",
        "incenteev/composer-parameter-handler" : "~2.0",
        "sonata-project/doctrine-phpcr-admin-bundle" : "dev-master",
        "sonata-project/intl-bundle" : "dev-master",
        "sensio/generator-bundle" : "2.3.*",
        "sensio/framework-extra-bundle" : "2.3.*",
        "doctrine/doctrine-bundle" : "1.2.*"
    },
    "autoload" : {
        "psr-0" : {
            "" : "src/"
        }
    },
    "minimum-stability" : "dev",
    "config" : {
        "bin-dir" : "bin"
    },
    "scripts" : {
        "post-update-cmd" : [
            "Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreateAndCkeditor",
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ],
        "post-install-cmd" : [
            "Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreateAndCkeditor",
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ]
    },
    "extra" : {
        "branch-alias" : {
            "dev-master" : "2.3-dev"
        },
        "symfony-web-dir" : "web",
        "symfony-app-dir" : "app",
        "incenteev-parameters" : {
            "file" : "app/config/parameters.yml"
        }
    }
}

Any suggestions what could go wrong here?

enigma
  • 493
  • 2
  • 5
  • 18
  • hard to tell, i don't see anything obviously wrong. a few things to check: do you get the grey create toolbar or not? are you logged in at that point and have the role that is allowed to use create.js? do you see any 404 in the network tab of firebug? do you see any javascript errors on the console? do you get the rdfa attributes on your content, does the template for the block use the createphp twig methods? – dbu Nov 08 '13 at 07:58
  • btw, i dont get notifications after the initial one, so best bring this question to https://github.com/symfony-cmf/CreateBundle/ if you need further help – dbu Nov 08 '13 at 07:58
  • The editor_gecko.css was not loaded, based on the wrong editor_base_path. I had `/bundles/cmfcreate/vendor/ckeditor/` configured, but as I found out, this was treated as an absolute path. I'm running the project on `localhost/projectname/web/app.php`. CMF Create tried to load this stylesheet from `localhost/bundles/...`. So I added the `editor_base_path: %project_root_prefix%/bundles/...` and added the parameter project_root_prefix: /projectname/web. Now it works, but I do not like this solution. Could anyone give me a hint, how I can configure editor_base_path a relative route? – enigma Nov 14 '13 at 18:05

0 Answers0