I'm interested in creating a plugin that does this simple task:
Steps
1. User selects some text by highlighting
2. user clicks the plug-in
3. CKEDITOR, wraps the selected text with a tag with some class and/or ID.
Can anyone help with this? I've been playing with CKEDITOR.htmlWriter but haven't even been able to get that started: http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.htmlWriter.html#constructor
Thanks!
Look at the basicstyles plugin, you just need to define a button that applies a "style", and you define what's the element, attributes and styles that this "style" means.
Related
i have ckeditor looking like this
i want that my ck-editor can insert hyperlink and image.like this
i've tried to search in documentation but i dont understand because its in english. and its hard for me to understand because im new for frontend
anyone please help
Possible solutions:
Download Full or Standard package from CKEditor download page. This package has both plugins you need.
It is possible that you are using Standard or Full packages already. You can verify that by opening ckeditor/build-config.js file and searching for preset word. If there is full or standard next to it, you have the right package and most likely you have changed your configuration. You may have used removeButtons or removeplugins settings where you remove Link and Image buttons or link and image plugins. You could have also used custom toolbar definition where you haven't added Link and Image buttons or you are missing links and insert groups. If you wish to learn more about toolbar concepts, please see:https://ckeditor.com/docs/ckeditor4/latest/guide/dev_toolbarconcepts.html and https://ckeditor.com/docs/ckeditor4/latest/guide/dev_toolbar.html.
I'm new to CKEditor development. I have written a plugin to insert custom tag element ( pre ) and update its attributes.
I want to open the plugin dialog( dialog name is snippet ) once user clicks the pre tag element, And i want to fill the textarea with clicked element innerHTML in dialog.
I have two questions.
How to invoke the plugin dialog dynamically?
How to access the elements inside the dialog?
Enjoy the official plugin development tutorial – there you'll find all the answers. You'll not be able to re-use another plugin's dialog easily though. You need another dialog.
But don't worry, you can copy&paste the source code of Source Dialog plugin's dialog, which is very simple, and use it for your plugin. Code Snippet dialog is also pretty straightforward.
Also
You may find Developer Tools plugin useful.
You can observe various events with the API of the editor easily (including click).
I have been searching special event hooks for use to track and update module forms. I found contenthooks on the documentation site but I couldn't get anything for modules. I want to add a plugin so that it adds an extra field viz. radio button to every module form. Finally I want to use the value of this radio field in templates/your-template/html/module.php. Can someone point me in the right direction towards this. Thanks :)
Jooma does not have event driven structure like for example .NET or Java. However if you want to trigger some additional functionality on certain event you may create a plugin. Plugin is something different than module or component but it 'collaborates' with them. It handles some per-defined events:
[http://docs.joomla.org/Plugin/Events][1]
[1]: http://docs.joomla.org/Plugin/Events and it lets you define your own.
You may also try the way I usually take which is customize module display. You simply copy
view file of the module you want to modify to your template. For example:
/modules/mod_feed/tmpl/default.php
to
/templates/{your template}/mod_feed/default.php
Now you can freely modify this file without any risk that it may be overwritten on the next Joomla update. Just don't forget to set your overwrite in module settings: go to administrator, modules, choose module to edit and in the tab 'Advanced' select 'Alternative Layout'.
I hope this helps and good luck!
Take a look at the new com_ajax that is in 3.2.
I'm trying to make a plugin for each administration page with editor fields i.e. on the new article page or the new category page.
I'm not sure how exactly I should arrange this. It is a must that the triggers already exist i.e. I don't want to edit any template files.
So I have to use one of these then:
system type
content type
editors type
editors-xtd type
Where should I put this plugin? A system plugin might work but then the plugin gets triggered on each page which I find not the best
The content type won't get triggered at all.
The Editors type doesn't work either.
The editors-xtd works but it wants a button back as a return vale and I dont have a button because the plugin is mostly javascript based and automatic
What else can I use?
Thanks
Even though you're talking about a plugin, if you're talking about the editor field Joomla has it built in using JForm:
XML
<field name="test1"
label ="Test Field"
type="editor"
width="300"
filter="safehtml"
/>
(Note: editor, not editors) See this link for more information. Also, looks like this page was just put up yesterday - probably also has more information that could be useful since it sounds like a component may be more useful to you than a plugin.
I'm starting to develop a plugin for CKEditor that needs to be used to insert some HTML snippets in a web page. This is done. Nonetheless I also need to include some special items when switching to WYSIWYG mode (e.g. something more or less similar to Show Blocks plugin, but not just using styles since I need some elements included in there). So my question is :
How could I include extra items or styles (e.g. to hide parts of the contents in WYSIWYG mode) in WYSIWYG view without altering HTML output ?
If someone could provide some information about a working (maybe simple) example, I'd also appreciate your help.
PS: If you need to know further details please ask, but for instance assume inserted raw HTML code is
<div class="xxx">Hello world !</div>
... but in WYSIWYG mode need to display a link on top of it that pops up an alert and toggles dotted border.
About injecting CSS classes in WYSIWYG mode, use addCss function.
About creating fake elements in WYSIWYG mode ... I think I can solve the problem using context menu instead.