【问题标题】:Drupal 7 WYSIWYG module with latest ckeditor font change具有最新 ckeditor 字体更改的 Drupal 7 WYSIWYG 模块
【发布时间】:2015-01-25 03:01:32
【问题描述】:

我想将默认的“Timesnewroman”字体更改为“Verdana”/其他字体。我在 config.js 中尝试了config.font_styleconfig.font_names,但没有成功。是否有任何解决方法可以更改此设置。

注意:我通过 Drupal 7 WYSIWYG 模块使用 ckeditor 插件。

【问题讨论】:

  • 最终控制字体的是 CSS 或 HTML style 属性。查看 CKEditor 生成的源代码,了解字体是如何处理的。如果是 css 类,您可以在 CSS 中覆盖它们。如果它作为 HTML 样式嵌入,则需要手动或通过脚本更改它们。如果我是你,我会制定 ACF 规则来禁止样式,阻止用户选择字体并仅使用 CSS。 (如果可能在drupal中......我不知道所以这只是一个评论:))

标签: drupal-7 ckeditor drupal-modules wysiwyg


【解决方案1】:

你可以在你的 template.php 文件中使用钩子

function THEMENAME_wysiwyg_editor_settings_alter(&$settings, $context) {
    if ($context['profile']->editor == 'ckeditor') {
        $settings['font_names'] = 'Arial/Arial, Helvetica, sans-serif; Times New Roman/Times New Roman, Times, serif;Verdana';
        $settings['font_defaultLabel'] = 'Verdana';
    }
}

您还可以为 CKEditor 添加其他设置

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-03-26
    • 1970-01-01
    • 2011-11-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多