Skip to content

not work #1

@cyberomulus

Description

@cyberomulus

Hello,

I install FaiblUG/LcnWYSIHTML5Bundle

In composer.json :

"require" : {
"locaine/lcn-template-block-bundle" : "~1.0",
"locaine/lcn-include-assets-bundle" : "~1.0",
 "locaine/lcn-wysihtml5-bundle" : "~1.0",
},

and in AppKernel.php:

new Lcn\TemplateBlockBundle\LcnTemplateBlockBundle(),
new Lcn\IncludeAssetsBundle\LcnIncludeAssetsBundle(),
new Lcn\WYSIHTML5Bundle\LcnWYSIHTML5Bundle(),

In a type:

class NewsAddType extends AbstractType
    {
   public function buildForm(FormBuilderInterface $builder, array $options)
        {
        $builder->add('contenu', "lcn_wysihtml5", array())
        }
    }

The result is :

<div id="lcn-wysihtml5-djhugo_adminbundle_news_add_contenu-toolbar" class="toolbar" style="display: none;">

I tried putting it in :

###lcn_include_stylesheets###
</head>
<body>
###lcn_include_javascripts###

and I get this:

<link rel="stylesheet" href="/bundles/lcnwysihtml5/dist/themes/basic/controls.min.css">
</head>
<body>
<script src="/bundles/lcnwysihtml5/bower/wysihtml/dist/wysihtml5x-toolbar.min.js"></script>
<script src="/bundles/lcnwysihtml5/dist/themes/basic/parser_rules.min.js"></script>
<script>
var editor = new wysihtml5.Editor("djhugo_adminbundle_news_add_contenu", { // id of textarea element
toolbar: "lcn-wysihtml5-djhugo_adminbundle_news_add_contenu-toolbar", // id of toolbar element
parserRules:  wysihtml5ParserRules, // defined in parser rules set
stylesheets: ["\/bundles\/lcnwysihtml5\/dist\/themes\/basic\/content.min.css"]
});</script>
...
...
<div id="lcn-wysihtml5-djhugo_adminbundle_news_add_contenu-toolbar" class="toolbar" style="display: none;">

In console :

Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost/bundles/lcnwysihtml5/dist/themes/basic/controls.min.css".
wysihtml5x-toolbar.min.js:1 Uncaught SyntaxError: Unexpected token <
(index):35 Resource interpreted as Script but transferred with MIME type text/html: "http://localhost/bundles/lcnwysihtml5/bower/wysihtml/dist/wysihtml5x-toolbar.min.js".
parser_rules.min.js:1 Uncaught SyntaxError: Unexpected token <
(index):38 Uncaught ReferenceError: wysihtml5 is not defined
(index):36 Resource interpreted as Script but transferred with MIME type text/html: "http://localhost/bundles/lcnwysihtml5/dist/themes/basic/parser_rules.min.js".

In js et css, the code is in html...

i use this version:
locaine/lcn-include-assets-bundle (1.1.0)
locaine/lcn-wysihtml5-bundle (1.0.8)
locaine/lcn-template-block-bundle (1.0.1)

How to install and use ?
Where is my error ?

thank

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions