-
-
Notifications
You must be signed in to change notification settings - Fork 213
2.11.x bug: can't use different 'rte' for two fields in one DCA #4453
Comments
Damn, i thought we fixed this bug in ... contao 2.8? |
I don't remember that we had fixed it or ever planned to fix it. I don't think it would work with the current implementation, either. |
So, if this is not a bug, then I would like that it will became a feature request. |
Also ich hab #2536 gefunden und laut diesem Ticket sollte das funktionieren. |
Sehr gerne, vielen Dank :) |
Das Problem liegt im DataContainer, hier wird ein Lösung: Ggf. könnten wir nur für Subpaletten den |
Genau wegen den Ajax-Subpaletten haben wir das "exact" geändert. Sprechen wir denn von zweinTinyMCE configs oder einem anderen Editor? Gehen überhaut zwei tinyMCE parallel? |
Du kannst auf einer Seite beliebig viele tinyMCE Instanzen mit jeweils einer speziellen Config betreiben (theoretisch). Ich hätte das schon öfters gebraucht:
|
Bezüglich Deiner Lösungsidee: Welche TinyMCE-Konfiguration würde denn geladen, wenn eine Subpalette |
das würde vermutlich über die (globale) Variable definiert, welche angesprochen wird? |
Ich hab eine Idee
if(typeof TinyMceCfg == 'undefined') var TinyMceCfg = [];
TinyMceCfg['tinyMCE_standard'] = function()
{
tinyMCE.init({
mode : "none",
....
} if(typeof TinyMceCfg == 'undefined') var TinyMceCfg = [];
TinyMceCfg['tinyMCE_reduced'] = function()
{
tinyMCE.init({
mode : "none",
....
}
$updateMode = "\n <script>TinyMceCfg['".$arrData['eval']['rte']."'](); tinyMCE.execCommand('mceAddControl', false, 'ctrl_".$this->strInputName."');$('ctrl_".$this->strInputName."').erase('required');</script>"; Natürlich könnten wir das noch "schön" implementieren und uns merken welche init-config als letztes geladen wurde. Auf einen Bugfix bei TinyMCE direkt brauchen wir wohl nicht warten. |
if(typeof TinyMceCfg == 'undefined') var TinyMceCfg = []; can be simplified as var TinyMceCfg = TinyMceCfg || []; |
PS: Schaffen wir einen deartigen Fix in 2.11.7? Ansonsten würde ich einen Workaround in den TinyMCE_Customizer einbauen. |
Der TinyMCE_Customzer fixt das Problem durch eine proxy-Methode auf tinyMCE.execCommand(), siehe tinyMCE.php Template Eventuell könnte man das auch so in den Core übernehmen. |
Der korrekt Link ist: https://gist.github.com/4665046 |
We moved the ticket to the 4.0 release, because the changes needed to fix the issue will break backwards compatibility. |
Die Lösung ist prinzipiell, den |
Sooo... hier eine vollständig rückwärtskompatible Implementation. Das Script muss lediglich unten in die tiny_mce_gz.js eingefügt werden. EDIT: hab das in ein gist abgelegt: https://gist.github.com/4682480 |
Ich habe das gist aktualisiert. Nun ist das Script nicht mehr abhängig von MooTools und sollte noch kompatibler mit eigenen tinyMCE-Befehlen sein. |
Sieht super aus, aber mangels Kommentaren habe ich keine Ahnung, was Du da machst :D |
na ich dachte ich programmier das wie tinyMCE das macht ^^ |
Sehr nice Andy ;) Aber schon bissle böse ^_^ |
Allow to run multiple TinyMCE instances with different configurations on the same page (thanks to Andreas Schempp) (see #4453)
Behoben in d8715b0. Großen Respekt für Deine Lösung! |
Leider aber nicht ohne Nebenwirkungen. |
Die da wären? |
Die da: #5346 |
Here is the problem.
In
dcaconfig.php
I rewriterte
eval
property forNews
andCalendar
modules. Example:In this case I expected to see for News field
teaser
tinyMCE config fromtinySimple.php
file and fortext
field - fromtinyCustom.php
file. But Contao loads only the lasttinyCustom
for this two fields. If to change previous code to this:then Contao will load only
tinySimple
config for this two fields.The same will happen if to make changes in
news/dca/tl_news.php
file:So, the problem is in that we can't use different tinyMCE configs in one table DCA.
The text was updated successfully, but these errors were encountered: