A very simple plugin for inserting one piece of preset HTML content.
Specify the HTML in the command InsertHtml on line 34 in 'fckplugin.js'.
Could be extended to be able to specify multiple HTML snippets and show a dialog to select one to insert... (Should you want this functionality and have a donation to spare, feel free to contact me)
Logged In: YES
user_id=1371356
Originator: YES
File Added: insertHtml.zip
Logged In: YES
user_id=1356422
Originator: NO
Forgive me if I'm missing something, but your suggestion about multiple HTML snippets sounds just like the Templates command in the editor. And even there's another plugin that allows to insert any HTML, not restricted to any previous text.
Logged In: YES
user_id=1371356
Originator: YES
Ah indeed, the templates system could work here too. About the other plugin, not sure, does it popup a dialog to let you enter HTML or does it allow you to pick any of multiple predefined snippets?
If my above assumption of the other plugin is correct, then I guess the simplicity of the inserHTML plugin remains to be its only strength: you can let your users easily insert HTML by clicking just a single button...
Logged In: YES
user_id=1356422
Originator: NO
The other plugin that I have in mind does present a dialog to enter the HTML to be introduced. As you say, if you want your users to enter just a fixed string then this plugin is a good example of how to do it, but I would have placed the string as a configuration item, not hardcoded inside the plugin.
Logged In: YES
user_id=1371356
Originator: YES
Indeed, as it now turns out to remain a 'single HTML snippet input button', this snippet would indeed be best configurable from out of the fckconfig file.
UPDATE:
This has been changed and the snippet you want to insert can be configured with the variable FCKConfig.insertHtml_snippet in your fckconfig.js.
E.g.
FCKConfig.Plugins.Add('insertHtml');
FCKConfig.insertHtml_snippet = '<br /><div class="contentBlock"><div class="top">title</div><div class="bottom">text</div></div><br />';
This plugin is now and will remain a 'Very simple plugin for inserting just one piece of preset HTML content.'
File Added: insertHtml.zip
Logged In: YES
user_id=1371356
Originator: YES
Update:
As there only one single configurable HTML snippet that can be inserted, the tooltip should describe this snippet and thus should be configurable too. That is now possible and the full code to add and configure the plugin in fckconfig.js is now:
FCKConfig.Plugins.Add('insertHtml');
FCKConfig.insertHtml_snippet = '<br /><div class="contentBlock"><div class="top">title</div><div class="bottom">text</div></div><br />';
FCKConfig.insertHtml_tooltip = 'Whatever tooltip you want to appear, e.g. a description of the element being inserted';
File Added: insertHtml.zip
Logged In: YES
user_id=2042957
Originator: NO
A neat little plugin. How do I make sure that the html being inserted isn't stripped when saving the post? (I'm using Wordpress)
Logged In: YES
user_id=2079743
Originator: NO
I'm having problems to even get this plugin to work: I have copied the insertHtml folder into editor/plugins on the server, copied those lines into fckconfig.js and even cleared my browser cache but the button simply won't show up in the editor's tool bar.
Any hints as to what I might have done wrong?!
TOM
Logged In: YES
user_id=1371356
Originator: YES
crazylexx, You'll have to add 'insertHtml' to the toolbar, see the docs http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Toolbar
manne-1, try the Wordpress community for help
I keep getting an error when trying to download the code. Can you email it to me? mailto:john.dolby@casa.gov.au
Update:
I've added an option to choose between inserting just one snippet of pre-configured HTML or the ability to enter HTML into a dialog and have it inserted at the location of the cursor in the editor.
The size of the textarea into which HTML can be inserted can be configured and the dialog will automatically adapt to this size. For all the configuration options see the included 'help.txt' file.
File Added: insertHtml.zip
Can this plugin allow to insert also php code and JavaScript code?
If can't, I suggest the author to add this feature. You can make a dropdown list above the textarea, then user can select HTML or php or JS, then paste their code into the textarea.
Thanks.
I don't see a download button to get this plugin... how can I get it?
never mind... escrow down to the end of this page and there is an Attached file link...
I see that we can't edit a preexisting html after having selected a code
Plugin Update:
You can now also configure a list of snippets to provide to the user to choose from; or let him enter HTML manually. See the included help file for more information.
insertHtml.zip
View and moderate all "plugins Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Plugins"
~~~~
$(".voce-secondaria2").hover (function() {
$(this).addClass("menu_secondario_hover");
},
function () {
$(this).removeClass("menu_secondario_hover");
});
~~~~Hi saul11, a nice plugin this is. Though I'm missing something, if I would know more about Java I´d like to do it myself.... anyway, I'd like to have the option to defineseveral freetextoptions in a snippet. E.g
[code]
'TextToggle': '<h2 class="trigger"><a href="#">FreeTEXT Header</a></h2><div class="toggle_container"><div class="block"><h3> optional Freetext Content Header</h3> Freetext</div></div>',
[/code]
So for the fields FreetTEXT header, optional Content HEader and Freetext I would like to have a own Freetext field inside the insetHTML module when opening this particular snippet.
All of what I'm asking here does also work directly from inside FCK but is a lot of hassle, especially when starting to edit the design.
Feel free to contact me for anything.
With best regards,
J
Last edit: Anonymous 2016-02-16