Comments (10)
// config
window.CKEDITOR.config.customConfig = window.CKEDITOR_BASEPATH + window.CKEDITOR.config.customConfig;
// plugin
window.CKEDITOR.plugins.basePath = window.CKEDITOR_BASEPATH + window.CKEDITOR.plugins.basePath;
// add plugin
window.CKEDITOR.plugins.addExternal('sourcedialog', '/bundles/.../plugins/sourcedialog/','plugin.js');
window.CKEDITOR.config.extraPlugins = 'sourcedialog';
// remove plugin
window.CKEDITOR.config.removePlugins = 'smiley,flash,horizontalrule,magicline,pagebreak,iframe,wsc';
...
from create-bundle.
I guess one should override the includejsfiles-ckeditor.html.twig
file by extending the CreateBundle and include any custom configuration after bootstrapping the ckeditor.
Example:
{% include "SymfonyCmfCreateBundle::includejsfiles-create.html.twig" %}
<script>window.CKEDITOR_BASEPATH = '{{ cmfCreateEditorBasePath }}';</script>
{% javascripts output="/js/ckeditor.js"
'@SymfonyCmfCreateBundle/Resources/public/js/init-create-ckeditor.js'
'@SymfonyCmfCreateBundle/Resources/public/vendor/ckeditor/ckeditor.js'
%}
<script src="{{ asset_url }}"></script>
<script type="text/javascript">
$(document).ready(function(){
window.CKEDITOR.plugins.addExternal('dynamicfieldprice', '/bundles/customcreate/vendor/ckeditor/plugins/dynamicfieldprice/','plugin.js');
window.CKEDITOR.config.extraPlugins = 'dynamicfieldprice';
});
</script>
{% endjavascripts %}
from create-bundle.
I guess this would not be very developer friendly or at least it did not came natural to me.
Wouldn't assetic be able to handle it for us, so we can escape the need for extending the bundle only for providing some additional configuration for the ckeditor?
from create-bundle.
if i understand kossi correctly he is saying that you can let the default stuff happen but include your own javascript afterwards to change the configuration.
from create-bundle.
Yes, I've provided the example from my case and it works just fine.
My point was that there could be more elegant solution.
from create-bundle.
if you can make a PR don't hesitate ;)
from create-bundle.
But it should not be needed to extend the bundle or replace a template, just have some js executed after the call to load create. Did you need to do more than that?
----- Reply message -----
Von: "Nikola Petkanski" [email protected]
An: "symfony-cmf/CreateBundle" [email protected]
Cc: "David Buchmann" [email protected]
Betreff: [CreateBundle] Provide means to configure ckeditor (#53)
Datum: Di., Mai. 14, 2013 17:02
Yes, I've provided the example from my case and it works just fine.
My point was that there could be more elegant solution.
—
Reply to this email directly or view it on GitHub.
from create-bundle.
Well, we already have the privilege check in place. I see no reason to duplicate logic.
I think extending the template is the way. app/Resources/views
can be used in order to avoid extending the template for just one template file.
from create-bundle.
i still don't see why/if you need to replace the template or if you can just add your own js after that. unless you want to run the includejsfile action in many places, in which case overwriting the template in app/Resources would indeed be the easiest.
from create-bundle.
I don't like the way the configuration can be done atm.
I will make a PR once I figure out solution that is more flexible.
from create-bundle.
Related Issues (20)
- update .travis.yml build matrix and allowed failures
- Working with CKEditor : button 'source' is disabled HOT 2
- Custom workflows do not work, there is no subject. HOT 4
- configuration problem when using CreateBundle alone HOT 4
- see about integration with "php-schema" generator lib HOT 2
- When install out of box create.js not loaded properly and css as well HOT 8
- No RDFa mapping found HOT 1
- [RFC] Dispatch some events in RestController HOT 6
- Unable to find file hallo.coffee HOT 2
- [2.0] Update RoleAccessChecker for SecurityContext split HOT 1
- Errors on cache warmup without database being available
- Any chance for new stable release? HOT 1
- Packagist doesn't see 1.3.0 HOT 1
- RoleAccessChecker is not being injected with the correct services HOT 1
- Remove class parameters
- Remove deprecation warning
- New File Structure
- Upgrade Files
- Attempted to load class "Twig_Function_Method" from the global namespace. HOT 2
- Content loaded in a wrong language HOT 4
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 create-bundle.