【发布时间】:2018-06-21 22:46:04
【问题描述】:
在 SS 3.x 中,我们可以使用以下代码通过 Styles 下拉菜单将自定义元素添加到 HTMLEditorField 内容编辑器中。我的主要用途是将标准链接转换为样式按钮链接。
我们如何在 SS 4.x 中实现这一点?
这是在 3.x 中完成的
_config.php
<?php
$formats = array(
array(
'title' => 'Buttons'
),
array(
'title' => 'Custom Button',
'attributes' => array('class'=>'custom-btn'),
'selector' => 'a'
)
);
//Set the dropdown menu options
HtmlEditorConfig::get('cms')->setOption('style_formats',$formats);
【问题讨论】:
标签: silverstripe silverstripe-4