Giter VIP home page Giter VIP logo

tinymce4's Introduction

TinyMCE4-Editor für REDAXO 5

Default-Profil

{
selector: 'textarea.tinyMCEEditor',
file_browser_callback: redaxo5FileBrowser,
plugins: 'advlist autolink lists link image charmap print preview anchor searchreplace visualblocks code fullscreen insertdatetime media table contextmenu paste code',
toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
convert_urls: false,
content_css: '/assets/addons/tinymce4/bootstrap/css/bootstrap.min.css',
}

Wichtig: redaxo5FileBrowser ist eine Funktion. Darum werden an dieser Stelle keine Quotes verwendet.

Empfehlungen

convert_urls: false

Wenn convert_urls: true ist, dann verändert Tinymce eingegebene URLs beim speichern. Zum Beispiel wird eine URL /media/xxx in ../media/xxx umgewandelt. Dies ist meistens nicht gewünscht, daher sollte convert_urls: false im Profil enthalten sein (beim Default-Profil ist das schon drin).

Weitere Infos zum Thema: https://www.tinymce.com/docs/configure/url-handling/

Bootstrap-Tabellenlayout im edit

Damit die Bootstrap-Tabellenklassen rsp. auch die Bootstrap-Bilder-Klassen im Editor verfügbar sind, kann das folgende Snippet dem Profil hinzu gefügt werden:

table_class_list: [
    {title: 'None', value: ''},
    {title: 'Table', value: 'table'},
    {title: 'Table striped', value: 'table-striped'}
], 
image_advtab: true,
image_class_list: [
    {title: 'None', value: ''},
    {title: 'Abgerundet', value: 'img-rounded'},
    {title: 'Kreis', value: 'img-circle'},
    {title: 'Responsive', value: 'img-responsive'}
]

Microsoft Word HTML automatisch beim Einfügen entfernen

Damit unnötiger Word HTML Krempel beim Einfügen automatisch entfernt wird (Redakteure werden euch lieben), aber sonstige Formatierungen erhalten bleiben, einfach die Config mit folgendem Snippet erweitern (wichtig, das Plugin paste wird benötigt, siehe Default-Profil oben).

Im paste_word_valid_elements können die Tags erfasst werden, die beibelassen werden sollen. Alles andere wird herausgefiltert.

convert_fonts_to_spans: true,
paste_word_valid_elements: "b,strong,i,em,h1,h2,u,p,ol,ul,li,a[href],span,mark,table,tr,td",
paste_retain_style_properties: "all",
paste_postprocess: function(plugin, args) {
    args.node.innerHTML = tinymce4_cleanHTML(args.node.innerHTML);
}

tinymce4's People

Contributors

akuehnis avatar godsdog avatar joachimdoerr avatar lexplatt avatar schuer avatar skerbis avatar staabm avatar ynamite avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.