ProcessWire - Editor: Unterschied zwischen den Versionen
Steff (Diskussion | Beiträge) |
Steff (Diskussion | Beiträge) |
||
| 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