将 Bootstrap 类名添加到 Typo3 表 [英] Add Bootstrap class-names to Typo3 tables

查看:31
本文介绍了将 Bootstrap 类名添加到 Typo3 表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将 Bootstrap 表类添加到在 Typo3 v6.1 中创建的表中?在创建表格"类型的页面时,我注意到设置附加 CSS 类",但是:

Is there a possibility to add Bootstrap table-classes to tables created in Typo3 v6.1? I have noticed the setting "Additional CSS Class" when creating a page of type "Table", but:

  1. 它不会向我的表中添加任何类
  2. 它不支持添加多个类(逗号、空格等,保存时会被删除)

我想将 class="table table-hover" 添加到我创建的任何表中.另外,我认为我不需要默认类contenttable".

I would to add class="table table-hover" to any table I create. Also, I don't think that I need the default class "contenttable".

推荐答案

根据您的帖子,我假设您使用的是内容元素表,而不是 RTE 中的表.

From your post, I assume that you are using the content element table, not a table in the RTE.

覆盖 RTE 的类会很容易(在 TypoScript 设置中):

Overriding the classes of the RTE would be easy (in TypoScript setup):

lib.parseFunc_RTE {
    externalBlocks {
        table.stdWrap.HTMLparser.tags.table.fixAttrib.class {
            default = table table-hover
            always = 1
            list >
        }
    }
}

(TYPO3 默认为contenttable".)

(The TYPO3 default is "contenttable".)

覆盖表 CE 的类更难.仅尊重 FlexForm 值,如果未设置,则回退到标准类,请参阅 https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/css_styled_content/Classes/Controller/CssStyledContentController.php#l130

Overriding the classes of the table CE is harder. Only the FlexForm value is respected, if it is not set, it falls back to the standard classes, see https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/css_styled_content/Classes/Controller/CssStyledContentController.php#l130

您会在如何生成

中找到两种解决方案.表>与 TYPO3 中的 jQueryMobile 兼容.第一个对我来说似乎是最好的,第二个看起来很hacky.

You will find two solutions in How to generate <table> compatible with jQueryMobile in TYPO3. The first one seems the best to me, the second one looks very hacky.

这篇关于将 Bootstrap 类名添加到 Typo3 表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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