Note that there are some explanatory texts on larger screens.

plurals
  1. POCKeditor - Custom tags and symbols inside the editorwindow
    primarykey
    data
    text
    <p>When you insert a flash object into the CKeditor the editor window will show this symbol:</p> <p><img src="https://i.stack.imgur.com/xmavH.png" alt="alt text"></p> <p>I was wondering. Is it possible to do something similar when users inserts this tag into the editor (using regex {formbuilder=(\d+)}/ ):</p> <p>{formbuilder=2}</p> <p>If so, could someone please explain how to? :)</p> <p><strong>UPDATE:</strong></p> <p>I've been looking at the PageBreak plugin to try and understand what the hell is going on. The big difference between this plugin and mine is the way the HTML is inserted into the editor. </p> <pre><code>CKEDITOR.plugins.add('formbuilder', { init: function(editor) { var pluginName = 'formbuilder'; var windowObjectReference = null; editor.ui.addButton('Formbuilder', { label : editor.lang.common.form, command: pluginName, icon: 'http://' + top.location.host + '/publish/ckeditor/images/formbuilder.png', click: function (editor) { if (windowObjectReference == null || windowObjectReference.closed){ var siteid = $('#siteid').val(); windowObjectReference = window.open('/publish/formbuilder/index.php?siteid='+siteid,'Formbuilder','scrollbars=0,width=974,height=650'); } else { windowObjectReference.focus(); } } }); } }); </code></pre> <p>As you can see, my plugin opens a new window and the tag is inserted with:</p> <pre><code>function InsertForm(form_id) { // Get the editor instance that we want to interact with. var oEditor = CKEDITOR.instances.page_content; // Check the active editing mode. if ( oEditor.mode == 'wysiwyg' ) { // Insert the desired HTML. oEditor.insertHtml( '{formbuilder='+form_id+'}' ); } else alert( 'You must be on WYSIWYG mode!' ); } </code></pre> <p>The PageBreak plugin does everything when you click on the toolbar icon. This makes it possible to make the fakeImage inside the plugin file. For me on ther other hand, I don't see how this is possible :\</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload