ProcessWire - Editor: Unterschied zwischen den Versionen
Steff (Diskussion | Beiträge) |
Steff (Diskussion | Beiträge) |
||
| Zeile 51: | Zeile 51: | ||
{ name: 'Home Icon', element: 'i', attributes: {'class': 'fa fa-home fa-2x'} }, | { name: 'Home Icon', element: 'i', attributes: {'class': 'fa fa-home fa-2x'} }, | ||
{ name: 'Panel Title', element: 'h4', attributes: {'class': 'panel-title'} }, | { name: 'Panel Title', element: 'h4', attributes: {'class': 'panel-title'} }, | ||
| − | ]);</pre> | + | ]); |
| + | </pre> | ||
You could now select on-demand which <i> and <h4> you want to apply those styles. | You could now select on-demand which <i> and <h4> you want to apply those styles. | ||
Version vom 29. April 2017, 11:38 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
Eigene Stile zur Auswahl im Styles Dropdown
site->modules->InputfieldCKEditor->mystyle.js
Example:
/**
* mystyles.js
*
* This file may be used when you have "Styles" as one of the items in your toolbar.
* add mystyles:/site/modules/InputfieldCKEditor/mystyles.js in
* Field Settings > CKEditor Settings > Custom Editor JS Styles Set
*
* For a more comprehensive example, see the file ./ckeditor-[version]/styles.js
*
*/
CKEDITOR.stylesSet.add( 'mystyles', [
{ name: 'Home Icon', element: 'i', attributes: {'class': 'fa fa-home fa-2x'} },
{ name: 'Panel Title', element: 'h4', attributes: {'class': 'panel-title'} },
]);
You could now select on-demand which and