Yes, I know. I've mentioned Calleditor only because it is similar to what you're looking for. It's probably not hard to adapt Calleditor to this requirement, but it might not be so easy to adapt it to TinyMCE 4. I'll have a look.Tata wrote:This method seems not to work with v1.7.0. There are no warnings returned, but the styling is not adopted by the editor.
The Calleditor would be fine. But it didn't read all plugins installed, instead it offered some plugins I don't have installed at all. Also the problem is not in writing the plugin call. The purpose is in styling already inserted plugin call.
Highlight plugin calls
Re: Highlight plugin calls
Christoph M. Becker – Plugins for CMSimple_XH
Re: Highlight plugin calls
Maybe I wrote it not fully understandible. The plugin is fine. It would help many beginners to insert plugin calls correctly. But this is not a problem. And OTOH, the plugin calls provide many specific adjustments (variables etc.), which the plugin very probably doesn't know. So inserting the plugins by hand seems to me to be more comfortable, better controlled. Now I tried only to use the same adjustments to adminsfuncs.php and tinyMCE inits. And here the result was "0". It would be sufficient either to use the "placeholder" feature direct in tinyMCE (as Holger suggested) or some other adminfuncs feature that would automatically evaluate the {{{...}}}/#cmsimpls...;# and add the styling independent to active editor. For, I think, only very few admins would be able to made the necessary adjustments. Also I think, this feature is more aimed to beginners than to advanced users, who know how to handle the plugins calls.
The idea came from my experience, when users called me to check their webpages, because they got destroyed after some unintentional manimulation with the plugin calls.
The idea came from my experience, when users called me to check their webpages, because they got destroyed after some unintentional manimulation with the plugin calls.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Highlight plugin calls
I think I understand your idea quite well. So forget about the Calleditor plugin, because there's an even simpler solution for TinyMCE 3.
After adding the class mceNonEditable, the plugin calls are highlighted, and can't be edited anymore in WYSIWYG mode.
Contrary to the placeholder plugin for CKEditor this requires manual preparation, but it seems that is acceptable.
If you don't want to prevent editing of the calls, you don't need the noneditable plugin. And you can use another class name. For highlighting, the important part is to prepend body.mceContentBody to the class selector. If there are multiple templates in use, you could also add the style rule to core.css.
- edit the plugins/tinymce/inits/init_*.js and add noneditable to plugins, e.g.:
Code: Select all
plugins : "noneditable,advimage,advlink,autosave,contextmenu,emotions,fullscreen,insertdatetime,lists,media,paste,save,searchreplace,table,wordcount",
- Add the following to the template's stylesheet:
Code: Select all
body.mceContentBody .mceNonEditable { color: black; background: yellow; }
Code: Select all
<div class="mceNonEditable">{{{plugincall}}}</div>
Contrary to the placeholder plugin for CKEditor this requires manual preparation, but it seems that is acceptable.
If you don't want to prevent editing of the calls, you don't need the noneditable plugin. And you can use another class name. For highlighting, the important part is to prepend body.mceContentBody to the class selector. If there are multiple templates in use, you could also add the style rule to core.css.
Christoph M. Becker – Plugins for CMSimple_XH
Re: Highlight plugin calls
It is fine with your previous method in tinyMCE. I made it and tested with a couple of webpages. It works fine. The only that I have found later was, that the higlighting only occures after saving the page. This is not a big problem and it is logical.
It is not about blocking the calls editting. It is like "Don't touch if you are not sure what you are doing."
If a client demands to have some plugins installed, the designer writes the calls (I ususally make short manuals to each website with explanation how to adjust the plugin calls, if necessary). But the clients are always different. Some of them make the adjustments and the websites run smoothly. Some of them are affraid to make it. So I have to make it for them and here it may be very helpful to have the calls highlighted.
This is the reason why I think it may be very practical feature. I just have no clue hor to make it automatic and optional. I understand it must be set in each editor, or it would need some function able to modify the editor's setting.
It is not about blocking the calls editting. It is like "Don't touch if you are not sure what you are doing."
If a client demands to have some plugins installed, the designer writes the calls (I ususally make short manuals to each website with explanation how to adjust the plugin calls, if necessary). But the clients are always different. Some of them make the adjustments and the websites run smoothly. Some of them are affraid to make it. So I have to make it for them and here it may be very helpful to have the calls highlighted.
This is the reason why I think it may be very practical feature. I just have no clue hor to make it automatic and optional. I understand it must be set in each editor, or it would need some function able to modify the editor's setting.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Highlight plugin calls
I also think that this functionality would have to be (optionally) implemented for each editor. I'll try to find a better solution for TinyMCE.Tata wrote:I just have no clue hor to make it automatic and optional. I understand it must be set in each editor, or it would need some function able to modify the editor's setting.
Christoph M. Becker – Plugins for CMSimple_XH
Re: Highlight plugin calls
Maybe for TinyMCE4? For 3 it works already. It just needs adjusting deep saved files. Safer would be one external script able to handle these files.cmb wrote:I'll try to find a better solution for TinyMCE.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Highlight plugin calls
Again the same situation. On a webpage with a lot of subpages with a plugin call or a function almost on each one, the owner unintentionally deleted something in one of the hundreds calls and the webpage was gone. It was not a big problem for me to find the point. But it took some time, anyway.
So I thought again of the polugin/function call highlighting and if possible making it "blocked from any simple editing" but except of in the code view (where the enduser very seldom enter).
The webpage is upgradet to 1.7.2 and the methods mentioned above do not work (because of TinyMCE4(?)).
Nice would be have all codes inserted on pages automatically in styled. E.g.: An optional usable function (configurable - bool) and a styling in core.css (stylable - hell/dark) with hooks for at least CKEditor and TinyMCE4 would be great.
So I thought again of the polugin/function call highlighting and if possible making it "blocked from any simple editing" but except of in the code view (where the enduser very seldom enter).
The webpage is upgradet to 1.7.2 and the methods mentioned above do not work (because of TinyMCE4(?)).
Nice would be have all codes inserted on pages automatically in styled. E.g.: An optional usable function (configurable - bool) and a styling in core.css (stylable - hell/dark) with hooks for at least CKEditor and TinyMCE4 would be great.
You do not have the required permissions to view the files attached to this post.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Highlight plugin calls
Ich habe mir mal die Tiny-Doku durchgelesen und dann einen Schnellentwurf für ein Tiny-Plugin "xhplugincall" gemacht.
- entsprechend der Struktur kopieren
- in der Tinymce4–Konfiguration -> Init: "init_fontawesome-XH-plugincall" wählen
Es erscheint ein neuer Button in der Buttonleiste {} an letzter Stelle.
Nach Klick darauf, kann man seinen Plugin-Aufruf hineinkopieren.
Der ist im Editor dann farblich hervorgehoben (PostIt-Gelb) und kann in der Normalansicht nicht editiert werden.
Wahrscheinlich könnte man das noch komfortabler machen mit Parametern usw.
Kann ich aber nicht
Jetzt habe ich keine Zeit mehr - es ist TBBT-Montag
- entsprechend der Struktur kopieren
- in der Tinymce4–Konfiguration -> Init: "init_fontawesome-XH-plugincall" wählen
Es erscheint ein neuer Button in der Buttonleiste {} an letzter Stelle.
Nach Klick darauf, kann man seinen Plugin-Aufruf hineinkopieren.
Der ist im Editor dann farblich hervorgehoben (PostIt-Gelb) und kann in der Normalansicht nicht editiert werden.
Wahrscheinlich könnte man das noch komfortabler machen mit Parametern usw.
Kann ich aber nicht
Jetzt habe ich keine Zeit mehr - es ist TBBT-Montag
You do not have the required permissions to view the files attached to this post.
Re: Highlight plugin calls
Menno, da warst du aber schnell.
Die Idee stammt ja von Tata!
Und wir hatten intern auch noch weiter probiert.
Dabei haben wir auch festgestellt, dass es eine Lokalisation geben muss
Vor allem das Button-Bild {} fanden wir nicht optimal.
Deshalb im Anhang zwei alternative SVG-Vorschläge mit Icons - generiert aus FontAwesome.
Du müsstest nur in der "plugin.min.js" xhplugincall.png ändern zu xhplugincall.svg
Ganz echt richtig wäre es eigentlich, den Tiny-IcoMoon-Font mithilfe der IcoMoon-App um genau ein Icon zu erweitern und dann dieses zu verwenden.
Ich frage mich auch, ob es nicht besser wäre, im Hover-Text statt "Plugin einfügen" -> "XH-Plugin einfügen" zu schreiben - damit keine Irrtümer aufkommen.
You do not have the required permissions to view the files attached to this post.