Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save krasnikovdev/ed9bd10be0e10f562b900bcca7c21d93 to your computer and use it in GitHub Desktop.
Save krasnikovdev/ed9bd10be0e10f562b900bcca7c21d93 to your computer and use it in GitHub Desktop.
TinyMCE Rich Text Editor
Для переопределения параметров TinyMCE Rich Text Editor которые назначаются тегам нужно:
1. Создать файлик config.json в папке /assets/components/tinymcerte/js/mgr/extras/
2. Прописать путь до этого файла в настройке tinymcerte.external_config
{assets_path}components/tinymcerte/js/mgr/extras/config.json
Например для замены align="left" и align="right" на соответствующие классы файл config.json должен содержать:
{
"formats": {
"alignleft": {
"selector": "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",
"classes": "to-left",
"attributes":{
"align":"left"
}
},
"alignright": {
"selector": "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",
"classes": "to-right",
"attributes":{
"align":"right"
}
}
}
}
Полный список доступных для изменения параметров: https://www.tinymce.com/docs/demo/format-custom/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment