问题描述
我想在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:
祝你好运,
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类属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!