TinyMCE:使用带有formatselect-dropdown格式的CSS类属性 [英] TinyMCE: Using CSS class attributes with the formatselect-dropdown formats

查看:746
本文介绍了TinyMCE:使用带有formatselect-dropdown格式的CSS类属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在TinyMCE中自定义格式 a href =http://wiki.moxiecode.com/index.php/TinyMCE:Control_reference =nofollow noreferrer> format选择下拉列表以支持css类属性。

I would like to customize the formats in the TinyMCE formatselect dropdown to support css class attributes.

示例:如果希望能够选择< h2 class ='foo'> 而不是< h2> 作为formatselect下拉列表中的格式。

Example: If would like to be able to select <h2 class='foo'> instead of just <h2> as format in the formatselect dropdown.

这里有人知道我该怎么做吗?

Does anyone here have an idea how I could do this?

推荐答案

目前的TinyMCE版本中没有明智的方法可以做到这一点根据其主要开发者

There is no smart way to do this in the current TinyMCE version according to its main developer:


我们有一个计划高级样式
格式插件。这样你就可以在JSON样式结构中指定
格式,样式,容器,包装器
等。

We have plans for a advanced style format plugin. So that you can specify formats, styles, containers, wrappers etc in a JSON style structure.

祝你好运,

Spocke - TinyMCE的主要开发商

Spocke - Main developer of TinyMCE

...虽然有一种不智能的方式实现这个目标:

...though there is an "unsmart" way to achieve this:

在TinyMCE的 content_css中定义的CSS类 h2.foo / code>将出现在 styleselect下拉列表中 FOO

A CSS-class h2.foo defined in TinyMCE's content_css will appear in the styleselect dropdown as foo.

您现在可以选择< h2> -text并选择样式 foo 来自styleselect下拉列表。这导致< h2 class ='foo'>

You can now select a <h2>-text and choose the style foo from the styleselect dropdown. This results in <h2 class='foo'>.

这篇关于TinyMCE:使用带有formatselect-dropdown格式的CSS类属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆