除了HTML,在typo3中向页面添加按钮的简单方法是什么?

时间:2018-08-01 16:59:05

标签: typo3

向typ3中的页面(而不是html)添加按钮的简单方法(即所见即所得)是什么?

3 个答案:

答案 0 :(得分:1)

由于TYPO3中有两个WYSIWYG编辑器,因此我现在为您提供了将新类添加到的链接。 <a>标签:

使用RTE(TYPO3 <8): http://www.typo3-probleme.de/2015/10/02/typo3-6-2-rte-link-stil-class-hinzufuegen-1643/(不幸的是用德语进行了描述,但Google翻译可以提供帮助)

使用CKEditor(TYPO3> = 8): https://typo3worx.eu/2017/02/configure-ckeditor-in-typo3/

答案 1 :(得分:0)

我解决了扩展名gridelements的问题,其中包括用于配置的FlexForm。然后可以用作常见的内容元素。

我排除的另一种(第一种)方法是配置CKEditor。因为我甚至需要几个按钮的容器,也许我不知道如何及时解决它,所以我使用gridelements切换到解决方案。
在这里:

Flexform:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
    <ROOT type="array">
        <type>array</type>
        <el type="array">
            <color.select>
                <TCEforms>
                    <label>Button-Color (leave empty for individual color)</label>
                    <config>
                        <type>select</type>
                        <renderType>selectSingle</renderType>
                        <items>
                            <numIndex index="0" type="array">
                                <numIndex index="0"></numIndex>
                                <numIndex index="1"></numIndex>
                            </numIndex>
                            <numIndex index="1">
                                <numIndex index="0">brown</numIndex>
                                <numIndex index="1">#740e01</numIndex>
                            </numIndex>
                            <numIndex index="2">
                                <numIndex index="0">sand</numIndex>
                                <numIndex index="1">#ad9a63</numIndex>
                            </numIndex>
                            <numIndex index="3">
                                <numIndex index="0">orange</numIndex>
                                <numIndex index="1">#f0811b</numIndex>
                            </numIndex>
                        </items>
                    </config>
                </TCEforms>
            </color.select>
            <color.input type="array">
                <TCEforms type="array">
                    <label>Button-Color individual</label>
                    <config type="array">
                        <type>input</type>
                        <renderType>colorpicker</renderType>
                        <size>10</size>
                    </config>
                </TCEforms>
            </color.input>
            <link type="array">
                <TCEforms type="array">
                    <label>Button-Link</label>
                    <config type="array">
                        <type>group</type>
                        <internal_type>db</internal_type>
                        <allowed>pages</allowed>
                        <size>1</size>
                        <maxitems>1</maxitems>
                        <minitems>0</minitems>
                    </config>
                </TCEforms>
            </link>
            <text type="array">
                <TCEforms type="array">
                    <label>Button-Text</label>
                    <config type="array">
                        <type>input</type>
                    </config>
                </TCEforms>
            </text>
        </el>
    </ROOT>
</T3DataStructure>

在BE的gridelement-record中,您可以在文件存储中引用诸如fileadmin之类的xml文件,但是对于PhpMyAdmin,您也可以输入诸如EXT:your_extension/Configuration/FlexForm/Button.xml之类的内容。您还可以将具有xml文件的文件夹添加到仅具有读取访问权限的自己的文件存储中,然后可以由BE对话选择。
同样,您可以直接在gridelements记录的相应字段中输入XML,而无需引用XML文件。

gridelements中按钮的TypoScript:

tt_content.gridelements_pi1.20.10.setup {
    5 < lib.gridelements.defaultGridSetup
    5 {
        prepend = COA
        prepend {
            wrap = <div class="btn-container btn-full-size">|</div>
            10 = TEXT
            10 {
                data = field:flexform_text
                stdWrap.typolink {
                    parameter.data = field:flexform_link
                }
                stdWrap.outerWrap.cObject = COA
                stdWrap.outerWrap.cObject {
                    10 = TEXT
                    10.data = field:flexform_color.input
                    10.stdWrap.override.data = field:flexform_color.select
                    10.stdWrap.override.if {
                        isFalse.data = field:flexform_color.select
                        negate = 1
                    }
                    10.wrap = <p class="btn" style="background-color:|">
                    20 = TEXT
                    20.value = |</p>
                }
            }
        }
    }
}

顶部的数字5必须替换为加载flexform的相应网格元素的uid。将自动为行和列添加一些网格配置,只需忽略它(行:0,列:0)。

您当然可以改变TypoScript中的HTML包装器,也必须自己添加CSS;-)

因此可以肯定地涉及到HTML,但是编辑者可以添加按钮而无需直接使用HTML,而仅使用表单。

答案 2 :(得分:0)

您也可以给扩展掩码一个机会: [What I'm Trying to Do

使用此方法,您可以在后端为应自定义的所有输入创建带有输入字段的内容元素。这是我最喜欢的扩展之一。