Несколько примеров таблиц в конфигурации RTE - PullRequest
0 голосов
/ 12 ноября 2018

Я пытаюсь добавить несколько примеров таблиц в мою конфигурацию RTE для таблиц.Всякий раз, когда я добавляю второй тег под тегом, я получаю «{#undefined}» на кнопке «Вставить предопределенную таблицу» на моей панели инструментов RTE.После просмотра образцов конфигурации это выглядит правильно.Я что-то упустил?Я пытался использовать уникальный идентификатор и класс для каждого тега таблицы, но ничего не сделал.Есть ли еще что мне нужно сделать?Разве не возможно иметь несколько таблиц примеров для вставки с одной конфигурацией 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>
...