RTE配置中的多个样本表

时间:2018-11-12 16:24:52

标签: crafter-cms

我试图将多个示例表添加到表的RTE配置中。每当我在标签下添加第二个标签时,都会在RTE工具栏上的“插入预定义表”按钮中得到“ {#undefined}”。在查看示例配置后,这看起来是正确的。我还有其他东西吗?我已经尝试过为每个表标签使用唯一的ID和类,但是它什么也没做。还有什么我需要做的吗?实际上是否可以通过单个RTE配置插入多个示例表?

<?xml version="1.0" encoding="UTF-8"?>
<!--
    This file configures Studio's Rich Text Editor (RTE), and it supports several configuration profiles, where the
    content model selects which profile to use for which RTE field in the forms.
-->
<config>
    <setup>
        <id>generic</id> <!-- This starts a profile configuration -->
        <rteStylesheets> <!-- This informs the RTE to use the CSS files -->
            <link>
                <loadFromPreview>true</loadFromPreview>
                <url>/static-assets/css/bootstrap.min.css</url>
            </link>
            <link>
                <loadFromPreview>true</loadFromPreview>
                <url>/static-assets/styles/main.css</url>
            </link>
            <link>
                <loadFromPreview>true</loadFromPreview>
                <url>/static-assets/css/jquery.fancybox.min.css</url>
            </link>
            <link>
                <loadFromPreview>true</loadFromPreview>
                <url>/static-assets/css/horizontalgallery.css</url>
            </link>
        </rteStylesheets>

        <rteStyleOverride>
            body { margin: 10px !important; }
        </rteStyleOverride>

        <toolbarItems1>
            formatselect,|,bold,italic,underline,strikethrough,|,sub,sup,charmap,|,outdent,indent,blockquote,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,managedImage,link,unlink,anchor,|,edithtml,undo,redo
        </toolbarItems1>
        <toolbarItems2></toolbarItems2>
        <toolbarItems3></toolbarItems3>
        <toolbarItems4></toolbarItems4>

        <!-- Modules: -->
        <rteModules>
            <module>insert-image</module>
            <module>channel</module>
            <module>edit-html</module>
        </rteModules>
    </setup>


    <setup>
        <id>datatable</id> <!-- This starts a profile configuration -->
        <rteStylesheets> <!-- This informs the RTE to use the CSS files -->
            <link>
                <loadFromPreview>true</loadFromPreview>
                <url>/static-assets/css/bootstrap.min.css</url>
            </link>
            <link>
                <loadFromPreview>true</loadFromPreview>
                <url>/static-assets/styles/main.css</url>
            </link>

            <link>
                <loadFromPreview>true</loadFromPreview>
                <url>/static-assets/DataTables/css/datatables.min.css</url>
            </link>
        </rteStylesheets>

        <rteStyleOverride>
            body { margin: 10px !important; }
        </rteStyleOverride>

        <toolbarItems1>
            predefinedTable,tablecontrols,|,undo,redo
        </toolbarItems1>
        <toolbarItems2></toolbarItems2>
        <toolbarItems3></toolbarItems3>
        <toolbarItems4></toolbarItems4>

        <rteTables>
           <table>
              <name>Simple Table</name>
              <description>Simple Table</description>
              <!--<thumbnail>sample-table.jpg</thumbnail>
              <stylesheet>/sample-table.css</stylesheet>-->
              <prototype>
                <![CDATA[
                <table id="example" class="display" style="width:100%">
                <thead>
                <tr>
                    <th>Column 1</th>
                    <th>Column 2</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td>Tiger Nixon</td>
                    <td>System Architect</td>
                </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <th>Column 1</th>
                        <th>Column 2</th>
                    </tr>
                </tfoot>
                </table>
                ]]>
              </prototype>
           </table>
           <table>
              <name>Simple Table 2</name>
              <description>Simple Table 2</description>
              <!--<thumbnail>sample-table.jpg</thumbnail>
              <stylesheet>/sample-table.css</stylesheet>-->
              <prototype>
                <![CDATA[
                <table id="example2" class="display" style="width:100%">
                <thead>
                <tr>
                    <th>Column 1</th>
                    <th>Column 2</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td>Tiger Nixon</td>
                    <td>System Architect</td>
                </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <th>Column 1</th>
                        <th>Column 2</th>
                    </tr>
                </tfoot>
                </table>
                ]]>
              </prototype>
           </table>
        </rteTables>

        <!-- Modules: -->
        <rteModules>
            <module>insert-image</module>
            <module>insert-predefined-table</module>
        </rteModules>
    </setup>

</config>

0 个答案:

没有答案