2amigos / yii2-ckeditor-widget Goto Github PK
View Code? Open in Web Editor NEWCKEditor WYSIWYG widget for Yii2.
Home Page: https://2amigos.us/open-source/ckeditor-widget
License: Other
CKEditor WYSIWYG widget for Yii2.
Home Page: https://2amigos.us/open-source/ckeditor-widget
License: Other
I've got CKEditor displaying and functioning correctly using your widget. Unfortunately, what I've got is a miniscule, very narrow editor. Looking at the source code, I found that the editor is contained within a div with this specification <div class="col-sm-6 col-sm-offset-3">
. I've tried going through your widget code and can't find where this is set, and none of the parameter settings that I've been able to intuit or imagine tell me how to correct this weird setting. (Your instructions don't include what settings will work, and the comments in your widget code don't provide much if anything.) What I want is to have the editor's div setup as <div class="col-lg-12">
. (The editor will never be used on a mobile device or anything else with a small screen.)
How can I achieve this?
It would also be helpful to know how to make changes to the CKEditor.config settings. In particular, I need to change the CKEditor.config.uiColor setting. I've tried to do this in the config.js for CKEditor, in your widgets\full.php (I'm using the full preset), and as a last resort, tried doing a CKEditor.replace in the _form.php file itself. They all seem somehow to get trounced in the widget generation and produce no effect whatsoever.
Hello!
can you create new ckeditor widget with KCFinder?
thank you.
Hi,
Can you tell me how I update the config.js file to add this line in order to prevent filtering (for example I want to be able to add iframe (you tube) content
config.allowedContent = true;
Addition - sorted this one...sorry! Still working on the styles, and integration with ckfinder...
Also, I want to be able to change the styles.js file - can you tell me the best way to do this without having to edit the file itself?
Also, any tips on integrating with ckfinder would be great !!!!!!!!!!!!!! (I've tried using iutbay/yii2-kcfinder
without much joy).
I have always this error:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Reading bower.json of bower-asset/jquery (2.1.3)
Reading bower.json of bower-asset/jquery.inputmask (3.1.61)
Reading bower.json of bower-asset/punycode (v1.3.2)
Reading bower.json of bower-asset/yii2-pjax (v2.0.4)
Reading bower.json of bower-asset/jquery-ui (1.11.4)
Reading bower.json of bower-asset/bootstrap (v3.3.4)
Reading bower.json of bower-asset/typeahead.js (v0.10.5)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- 2amigos/yii2-ckeditor-widget 1.0.2 requires ckeditor/ckeditor dev-full/stable -> no matching package found.
- 2amigos/yii2-ckeditor-widget 1.0.1 requires ckeditor/ckeditor dev-full/stable -> no matching package found.
- 2amigos/yii2-ckeditor-widget 1.0.0 requires ckeditor/ckeditor dev-full/stable -> no matching package found.
- Installation request for 2amigos/yii2-ckeditor-widget ~1.0 -> satisfiable by 2amigos/yii2-ckeditor-widget[1.0.0, 1.0.1, 1.0.2].
Potential causes:
Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
My composer:
{
"name": "yiisoft/yii2-app-advanced",
"description": "Yii 2 Advanced Application Template",
"keywords": ["yii2", "framework", "advanced", "application template"],
"homepage": "http://www.yiiframework.com/",
"type": "project",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/yiisoft/yii2/issues?state=open",
"forum": "http://www.yiiframework.com/forum/",
"wiki": "http://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii",
"source": "https://github.com/yiisoft/yii2"
},
"minimum-stability": "stable",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "*",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*",
"mdmsoft/yii2-admin": "*",
"kartik-v/yii2-widgets": "*",
"2amigos/yii2-ckeditor-widget" : "~1.0"
},
"require-dev": {
"yiisoft/yii2-codeception": "*",
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-faker": "*"
},
"config": {
"process-timeout": 1800
},
"extra": {
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
}
can i custom my own ckeditor presets like full package ?
i've try and it just shown default widget before.
When i renderAjax a page with CKeditor in one of the text field, the CKeditor does not load. It only loads for pages loaded with render
I'm having trouble with minification with this version.
Is the current version "4.5.6", already solves the problem CKEDITOR.getUrl ();
Sorry for my English.
CKEditor strips html and body tags and I can see that we can set it using 'FCKConfig.ProtectedTags' => 'html|head|body'
Where do we specify this in the widget?
This simple demo supports image drag & drop on Chrome, Firefox ...
But the version that you packed into extension doesn support image drag & drop on Chrome. It works only on Firefox.
Please test it on Chrome
$form->field($model, 'content')->textarea(['rows' => 6])->widget(CKEditor::className(),[
'preset' => 'full',
'clientOptions' => [
'allowedContent' => true,
'extraPlugins' => 'pluginName'
]
]) ;
This don't work, assets not render plugin.js
<?php
use dosamigos\ckeditor\CKEditor;
use yii\widgets\ActiveForm;
use yii\helpers\Html;
use common\modules\relatorio\models\RelatorioHelper;
/**
* @var yii\web\View $this
* @var \common\modules\configuracao\Configuracao $modelCabecalho (Configuração do cabeçalho)
* @var \common\modules\configuracao\Configuracao $modelRodape (Configuração do rodapé)
*/
$form = ActiveForm::begin(['id' => 'form-configuracoes']);
?>
<h1 class="jumbotron"> Configurações Relatório </h1>
<?php
echo Html::label(Yii::t('app', 'Cabeçalho'), Html::getInputId($modelCabecalho, 'valor'));
echo $form->field($modelCabecalho, 'valor', ['template' => '{input}{hint}{error}'])->widget(CKEditor::className(), [
'options' => ['rows' => 3],
'clientOptions' => ['removePlugins' => 'save', 'removeButtons' => 'Source,Flash', 'width' => 832, 'height' => 150],
'preset' => 'full'
]);
echo Html::label(Yii::t('app', 'Rodapé'), Html::getInputId($modelRodape, 'valor'));
echo $form->field($modelRodape, 'valor', ['template' => '{input}{hint}{error}'])->widget(CKEditor::className(), [
'options' => ['rows' => 3],
'clientOptions' => ['removePlugins' => 'save', 'removeButtons' => 'Source,Flash', 'width' => 832, 'height' => 150],
'preset' => 'full'
]);
echo Html::submitButton('Enviar', ['class' => 'btn btn-primary']);
ActiveForm::end();
?>
Where did I go wrong?
Best Regards
Update extension to follow: https://github.com/2amigos/yii2-extension-skeleton
Hi Toni,
I know this extension has no release yet, but let me note this here ... the dev version of ckedior is not visible in a stable project.
If you need a dev version of ckeditor for development you can use branch aliases.
How can I add multiple ckeditor instances on one page?
I've tried this way but not working.
field($page, 'content')->textarea()->widget(CKEditor::className(), [ 'options' => ['rows' => 5], 'preset' => 'full', 'clientOptions' => [ 'baseHref' => 'http://www.example.com/path/' ], ]) ?>And I've tried edit on config.js also not working
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
};
CKEDITOR.config.baseHref = 'http://www.example.com/path/';
Could you tell the right way?
Thanks a lot before, your yii2-ckeditor-widget is helpful.
Hiii,
How can i initilized with jquery??
Text editor option is not same when i initilized with jquery and widgets provided by you.I initilized with this code.
$("#initText").ckeditor(function() {});
Thank you in advanced.
I added html tag with font awesome tag like empty
<i class="fa fa-camera-retro fa-lg"></i>
tag and it's not save, how to add configuration in array config like :
config.protectedSource.push(/<i[^>]><\/i>/g);
CKEDITOR.dtd.$removeEmpty['i'] = false;
On setting filebrowserUploadUrl
CKEditor should submit Yii::$app->request->csrfParam
and Yii::$app->request->csrfToken
so that the form works with CSRF validation.
As far as I know, the only way to solve this is injecting a hidden input in the upload form:
function prepareCkEditor(containerId)
{
if (jQuery('#' + containerId).length > 0) {
jQuery(document).on('click', '.cke_dialog_tabs a:eq(2)', function(event) {
var csrfTokenInput = jQuery('<input />');
csrfTokenInput.attr('type', 'hidden');
csrfTokenInput.attr('name', window.csrfVar);
csrfTokenInput.val(window.csrfToken);
jQuery('.cke_dialog_ui_input_file iframe').contents().find('form').append(csrfTokenInput);
});
}
}
I have a CKEditor extension I have been using and its having a highlightjs for Code syntax highlighting and a Pack of Emoticons for my forum. Now I want to migrate to this extension and need to know if there is easy way to add them without tampering with vendors DIR. Is there a way/plan to have them? They are pretty basic of stuffs these days
see my SO question:
http://stackoverflow.com/q/28690822/2559712
Hi, thank you for the widget. It is nice and easy to use.
I want to customize the tollbar, but I couldn't make it work. Can you explain me how to customize the toolbar? thanks.
I tried with the folling way, but it is not working :(
<?= $form->field($model, 'post_content')->widget(CKEditor::className(), [
'options' => ['rows' => 15],
'preset' => 'full',
'clientOptions' => [
'skin' => 'bootstrapck',
'format_tags' => 'p;h1;h2;h3;pre',
'enterMode' => 'CKEDITOR.ENTER_BR',
'toolbarGroups' => "
[
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'links' },
{ name: 'insert' },
{ name: 'forms' },
{ name: 'tools' },
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'others' },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ] },
{ name: 'styles' },
{ name: 'colors' },
{ name: 'about' }
];
",
],
]) ?>
Hello
Is it possible to create a new release with latest commits ?
Thanks
Unit mean that class should be tested without any external dependencies.
I used this code
field($model, 'information')->widget(CKEditor::className(),[ 'editorOptions' => [ 'preset' => 'full', 'inline' => false, //'filebrowserBrowseUrl'=>Yii::$app->getUrlManager()->createUrl('dashboard/test',['type'=>'Images']), 'filebrowserUploadUrl'=>Yii::$app->getUrlManager()->createUrl('dashboard/test') ], ]);?>but this is not working
if fixed it please help
How to disable beforeunload action when user is submitting a form?
Example:
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'text')->widget(\dosamigos\ckeditor\CKEditor::className(),[
'options' => ['rows' => 10],
'preset' => 'full'
]); ?>
Many Several toolbar not show. Like forms, align, colors etc. I used full preset.
'toolbarGroups' => [
['name' => 'document', 'groups' => ['mode', 'document', 'doctools']],
['name' => 'clipboard', 'groups' => ['clipboard', 'undo']],
['name' => 'editing', 'groups' => [ 'find', 'selection', 'spellchecker']],
['name' => 'forms'],
'/',
['name' => 'basicstyles', 'groups' => ['basicstyles', 'colors','cleanup']],
['name' => 'paragraph', 'groups' => [ 'list', 'indent', 'blocks', 'align', 'bidi' ]],
['name' => 'links'],
['name' => 'insert'],
'/',
['name' => 'styles'],
['name' => 'blocks'],
['name' => 'colors'],
['name' => 'tools'],
['name' => 'others'],
],
composer require 2amigos/yii2-ckeditor-widget:~1.0
while i run this i get error saying the dependent ckeditor dev-full/stable there is no stable version
I had this problem appeared in console.
I can't using this widget when i render view by renderPartial. This is a bug or I config wrong ?
I am using your widget in my application. There is a "content" field responsible for accepting text, and in my view it is defined like this:
<?= $form->field($model, 'content')->widget(CKEditor::className(),
['options' => ['rows' => 6],'preset' => 'full']) ?>
In my model there are only two rules defined for this content field: required and string.
When I write something in the CKEditor field and try to submit changes, I will get error " Content cannot be blank. " If I try to submit again ( without changing anything, just press submit button again ), everything that was written will be saved.
If I turn off required rule, I will be able to submit form, but text that is written in CKEditor field will not be saved.
What do you think, why is this happening ?
Hello
Thanks for this useful widget.
Just a little problem with ActiveForm and client validation on a required field, submit button will not trigger validation on the first time (since corresponding input is not updated). I can make a PR for this if you want.
There is just a brief introduction in the homepage to add plugin, but can someone please give a more detail steps I need to to to include a plugin? For example, I want to integrate the lineheight plugin, how can I do it? Directly download the plugin folder and put it in vendor folder? Or somewhere else? Thanks!
When i try to add a field with a CKEditor, it doesn't show the bar. All it shows is a resizable text input window. (see image)
Code:
use dosamigos\ckeditor\CKEditor;
$form = ActiveForm::begin() ?>
<?= $form->field($model, 'name')->widget(CKEditor::className(), [
'options' => ['rows' => 6],
'preset' => 'basic'
]) ?>
<?php ActiveForm::end() ?>
This is my code :
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\base\DynamicModel;
use dosamigos\ckeditor\CKEditor;
?>
<?php
$model = new \yii\base\DynamicModel(['cms_content']);
?>
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'cms_content')->widget(CKEditor::className(), [
'options' => ['rows' => 6],
'preset' => 'full'
]) ?>
<?php ActiveForm::end(); ?>
When I move cursor into textarea, strange tooltip are fired beside textarea Rich Text Editor, dynamicmodel-cms_content
how could this happen ?
Setting 'options' => ['rows' => 12] does nothing. There are still only the default 5 rows.
Enhance the extension to use bower asset plugin
When I select 'standard' as an option for the editor it displays the toolbars on three lines. There is enough space for these to display on a single line.
How can I make the editor do this as it looks very bad?
I set rows to be 5,6,3, or 2 but the height of ckeditor did'nt change.
Update extension to follow https://github.com/2amigos/yii2-extension-skeleton
Hello
It should be great to use another branch of ckeditor since dev-full/stable do not include common plugins (e.g. sourcedialog). And why not using bower assets ?
I need to add wordcount
plugin in CKeditor. please give me solution for this.
Hi!
I am tríing to install my vendor folder on a shared hosting server, so only ftp is available.
My solution is to use an own git repository for all the files I need in production and then use git-ftp to upload changes.
My problem is that in your extension folder there is an other .git folder, so I can't push this to my bitbucket repository.
Is there any way to ignore the .git folder somehow (ex. in the .gitignore file)?
Or do you have a working solution, how to deploy vendor folder on shared hosing?
Thanks,
Norbert.
if Enable image browser or not?
I was trying to use this repo using active form.
Editor was showing on screen.
But when i enter data and submit the data then only normal text is posted to the action of active form.
Is there is any way to access the html data of the editor on click submit.
After last update, the full version of ckeditor not render, only the basic or standart... why? :/
composer.json
"2amigos/yii2-ckeditor-widget" : "~1.0"
code
echo $form->field($modelCabecalho, 'valor', ['template' => '{input}{hint}{error}'])->widget(CKEditor::className(), [
'options' => ['rows' => 3],
'preset' => 'full'
]);
I dont find any option to configure file upload .
how can i configure to upload image?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.