Wie kann ich eigene Absatzformate in meine eigene Tiny-Konfiguration einbinden?
Ich hatte den gleichen Wunsch und bin nach einigem Herumprobieren zu folgender Lösung gekommen:
Wenn du dir eine Tiny_Custom.php und natürlich die passende .css (s. Wiki) angelegt hast, kannst du deine gewünschten Formate auch dort am Ende einfügen:
Code:
...
theme_advanced_buttons3 : "tablecontrols,separator,template,separator,charmap,emotions,separator,help",
theme_advanced_font_sizes : "9px,10px,11px,12px,13px,14px,15px,16px,17px,18px,19px,20px,21px,22px,23px,24px",
style_formats : [
{title : 'Fette Schrift', inline : 'b'},
{title : 'Roter Absatz', block : 'p', styles : {color : '#ff0000'}},
{title : 'Roter Header', block : 'h1', styles : {color : '#ff0000'}},
{title : 'Hinweis', block : 'div', classes : 'hinweis'},
{title : 'Info', block : 'p', classes : 'info'}
]
});
</script>
<?php endif; ?>
Die neuen Formate tauchen dann in der Formatliste auf (leider nicht in der Absatzliste, aber damit kann ich notfalls leben).
Durch die Angabe "block" statt "inline" wird die Formatierung automatisch auf den ganzen Block bezogen. Ob daraus dann ein div oder ein p wird, kannst du ebenso bestimmen wie die Zuweisung einer Klasse aus dem Stylesheet ('classes') oder ein direktes Stylen des Elements
tiny_absatz.jpg
Scheint bei mir jedenfalls zu funktionieren.
Lesezeichen