refinerycms wysiwyg 편집기에 h4 태그를 추가하려고합니다. 어떻게해야합니까? 이에 대한 문서를 찾지 못했습니다.refinerycms 편집기에 h4 태그를 추가하는 방법은 무엇입니까?
나는이 구성 VAR와 함께 뭔가를해야 겠지 :
config.wymeditor_whitelist_tags = {}
refinerycms wysiwyg 편집기에 h4 태그를 추가하려고합니다. 어떻게해야합니까? 이에 대한 문서를 찾지 못했습니다.refinerycms 편집기에 h4 태그를 추가하는 방법은 무엇입니까?
나는이 구성 VAR와 함께 뭔가를해야 겠지 :
config.wymeditor_whitelist_tags = {}
다음은 버전 정유 CMS의 2.x.x 및 3.x.x에 적용됩니다.
그러나 버전 3.x.x에서는 custom_wymeditor_boot_options 대신 custom_visual_editor_boot_options를 사용해야합니다.
이 파일을 사용하여 : https://github.com/refinery/refinerycms/blob/master/core/app/assets/javascripts/admin.js 정련소의 WYMeditor에 대한 사용자 정의 옵션을 지정할 수 있습니다. 다음과 같이 될
bundle exec rake refinery:override javascript=admin
이제 오픈 응용 프로그램/자산/자바 스크립트/admin.js 및 편집 :
첫째, 당신은 파일을 재정의해야
// Use this to customize the wymeditor boot process
// Just mirror the options specified in boot_wym.js with the new options here.
// This will completely override anything specified in boot_wym.js for that key.
// e.g. skin: 'something_else'
if (typeof(custom_wymeditor_boot_options) == "undefined") {
custom_wymeditor_boot_options = {
containersItems: [
{'name': 'h1', 'title':'Heading_1', 'css':'wym_containers_h1'}
, {'name': 'h2', 'title':'Heading_2', 'css':'wym_containers_h2'}
, {'name': 'h3', 'title':'Heading_3', 'css':'wym_containers_h3'}
, {'name': 'h4', 'title':'Heading_4', 'css':'wym_containers_h4'}
, {'name': 'p', 'title':'Paragraph', 'css':'wym_containers_p'}
]
};
}
참고 현재 컨테이너 태그로 h1, h2, h3 및 p 만 지정하는 boot_wym.js.erb를 무시하고 있습니다. 참조 : https://github.com/refinery/refinerycms/blob/2-0-stable/core/app/assets/javascripts/refinery/boot_wym.js.erb#L49-L54
custom_wymeditor_boot_options 내부에서 지정하는 옵션은 boot_wym.js.erb의 wymeditor_boot_options 내부의 내용을 덮어 쓰므로 올바른 Javascript인지 확인하십시오. 그렇지 않으면 편집기가 전혀로드되지 않습니다.
희망이 도움이됩니다. 내가 분명히 밝혀야 할 것이 있으면 알려주세요.
필
, admin.js를 오버라이드 (override)에 대한 명령은 "번들 간부 레이크 정유 : 자바 스크립트 = 관리자를 오버라이드 (override)"그냥 약간의 보정입니다 확장명은 .js –
OUT/또한 3.X에서 이름이 변경 됐어요 있습니다 W는 'custom_visual_editor_boot_options'에 ... 왜 그것이 작동하지 않는지 알아 내려고했습니다. https://github.com/parndt/refinerycms-wymeditor/blob/master/app/assets/javascripts/refinery/boot_wym.js.erb#L5 – natebeaty