Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在TYPO3 8.7中将htmlarea userElements迁移到CKEditor?_Ckeditor_Typo3_Rte_Typo3 8.7.x - Fatal编程技术网

如何在TYPO3 8.7中将htmlarea userElements迁移到CKEditor?

如何在TYPO3 8.7中将htmlarea userElements迁移到CKEditor?,ckeditor,typo3,rte,typo3-8.7.x,Ckeditor,Typo3,Rte,Typo3 8.7.x,我需要一些关于如何将用户元素从TYPO3 7.6中的htmlarea_rte迁移到TYPO3 8.7中的CKEditor的指针 或者重新表述我的问题:如何使用自定义html在CKEditor中预先添加链接 以下是我的userElements的外观: RTE.default { contentCSS = EXT:mytheme/Resources/Public/Css/Rte.css proc.allowTagsOutside := addToList(i,em) proc.entr

我需要一些关于如何将用户元素从TYPO3 7.6中的htmlarea_rte迁移到TYPO3 8.7中的CKEditor的指针

或者重新表述我的问题:如何使用自定义html在CKEditor中预先添加链接

以下是我的userElements的外观:

RTE.default {
  contentCSS = EXT:mytheme/Resources/Public/Css/Rte.css

  proc.allowTagsOutside := addToList(i,em)
  proc.entryHTMLparser_db.tags.i >
  proc.entryHTMLparser_db.tags.em >

  showButtons := addToList(user)

  proc.allowedClasses := addToList(envelope, phone, fax)
  classesCharacter = envelope, phone, fax

  userElements {
    10 = Icons
    10 {
      1 = E-Mail
      1.content (
<i class="envelope"></i>
      )

      2 = Telefon
      2.content (
<i class="phone"></i>
      )

      3 = Fax
      3.content (
<i class="fax"></i>
      )
    }
  }
}
RTE.default{
contentCSS=EXT:mytheme/Resources/Public/Css/Rte.Css
proc.allowTagsOutside:=添加列表(i,em)
proc.entryHTMLparser_db.tags.i>
proc.entryHTMLparser_db.tags.em>
showButtons:=添加列表(用户)
proc.allowedClasses:=添加列表(信封、电话、传真)
classesCharacter=信封、电话、传真
用户元素{
10=图标
10 {
1=电子邮件
1.内容(
)
2=电话
2.内容(
)
3=传真
3.内容(
)
}
}
}

那么您的问题是如何将这些样式(
等)添加到CKeditor

首先,添加.yaml配置文件(请参阅)

然后在
#内联样式
部分,您可以添加如下内容:

      - { name: 'Envelope', element: 'i', attributes: { 'class': 'envelope' } }

另请参见此处以获取参考:

我创建了一个小的CKEditor插件以满足我的需要:

“严格使用”;
(功能(){
CKEDITOR.dtd.$removempty.em=0;
CKEDITOR.dtd.$removempty.i=0;
CKEDITOR.plugins.add('icon-envelope'{
图标:“iconedevelope”,
init:函数(编辑器){
editor.ui.addButton('iconedevelope'{
标签:“图标电子邮件”,
工具栏:“插入”,
命令:“insertIconEnvelope”
});
editor.addCommand('insertIconEnvelope'{
执行:函数(编辑器){
var icon=editor.document.createElement('i');
icon.setAttribute('class','fa信封');
编辑器.插入元素(图标);
}
});
}
});

})();
使用
stylesSet
我可以向元素添加类,但我不想在这里存档。我想插入完整的代码段,例如,
,而不是包装任何现有文本。或者我需要创建自定义插件来存档此文件吗?在创建自定义插件之前,我会尝试使用;)说我不喜欢使用空标签来添加图标,我更喜欢使用
:before
伪元素