ProcessWire - Editor: Unterschied zwischen den Versionen

Aus Wikizone
Wechseln zu: Navigation, Suche
Zeile 32: Zeile 32:
 
};
 
};
 
</pre>
 
</pre>
 +
 +
==== Eigene Styles ====
 +
You can also add your personal styles in
 +
site->modules->InputfieldCKEditor->mystyle.js
 +
 +
Example:
 +
<pre>
 +
CKEDITOR.stylesSet.add( 'mystyles', [
 +
{ name: 'Credit Card Icon', element: 'i', attributes: {'class': 'uk-icon-credit-card-alt'} },
 +
{ name: 'Panel Title', element: 'h4', attributes: {'class': 'uk-panel-title'} },
 +
]);
 +
</pre>
 +
You could now select on-demand which <i> and <h4> you want to apply those styles.
 +
 +
http://docs.ckeditor.com/#!/api/CKEDITOR.stylesSet
  
 
=== Plugins hinzufügen ===
 
=== Plugins hinzufügen ===

Version vom 29. April 2017, 11:27 Uhr

Links

https://processwire.com/talk/topic/3023-module-ckeditor/

CKEditor

Ist der Standard Editor in PW

Konfiguration CKEditor

CKEditor für einzelne Felder konfigurieren

Siehe z.B. Alb-Massage.de

Wenn man ein Textarea Feld definiert, kann man auch für dieses Feld den CKEditor anpassen. Das geht unter dem Reiter Eingabe.

Beispiel: Hier werden Buttons für die Textausrichtung hinzugefügt.

Format, Styles, -, Bold, Italic,Superscript, -,JustifyLeft,JustifyCenter,JustifyRight,-, RemoveFormat
NumberedList, BulletedList, -, Blockquote
PWLink, Unlink, Anchor

PWImage, Table, HorizontalRule, SpecialChar
PasteText, PasteFromWord,-,Undo,Redo
Scayt, -, Sourcedialog

Default Einstellungen

Kann man im Modulverzeichnis hinterlegen. Vorsicht bei Updates des Moduls. Zumindest früher wurde die Datei dann überschrieben.

/site/modules/InputfieldCKEditor/config.js -> überschreibt oder ergänzt die Default Einstellung
/site/modules/InputfieldCKEditor/config.body.js -> überschreibt oder ergänzt das body Feld

Beispiele:

config.startupOutlineBlocks = true;

CKEDITOR.editorConfig = function( config ) {
	config.justifyClasses = [ 'left', 'center', 'right', 'justify' ];
};

Eigene Styles

You can also add your personal styles in

site->modules->InputfieldCKEditor->mystyle.js

Example:

CKEDITOR.stylesSet.add( 'mystyles', [
 { name: 'Credit Card Icon', element: 'i', attributes: {'class': 'uk-icon-credit-card-alt'} },
 { name: 'Panel Title', element: 'h4', attributes: {'class': 'uk-panel-title'} },
]);

You could now select on-demand which and

you want to apply those styles. http://docs.ckeditor.com/#!/api/CKEDITOR.stylesSet

Plugins hinzufügen

CKEditor allgemeines Wissen

Ein paar Infos zu CKEditor ohne PW. Viele Dinge sind ähnlich

Plugins

Werden normalerweise mit einem Builder implementiert. Das geht bei PW nicht. Aber es gelten zum Teil die Regeln für Manuelle Installation. Manche Schritte z.B. aktivieren der Plugins macht man in PW aber wahlweise über die Feldkonfiguration.

Beispiel Widget Plugin:

If you want to add the plugin manually, you will need to:

  • Extract the downloaded plugin .zip into the plugins folder of your CKEditor installation. Example:
http://example.com/ckeditor/plugins/widget
  • Enable the plugin by using the extraPlugins configuration setting. Example:
config.extraPlugins = 'widget'; 
  • Download and configure all its dependencies, too.

In PW