Typo3 - Typoscript条件

时间:2011-02-18 12:00:15

标签: php typo3

我试图在我的数据结构中使用IMG_RESOURCE上的条件。但问题是这部分似乎不起作用:

the_img = IMG_RESOURCE
the_img.if.equals.field = field_positiontype
the_img.if.value = top

the_img.file.XY = 200,150
the_img.file.import = uploads/tx_templavoila/
the_img.file.import.field = field_tabimage
the_img.file.import.listNum = 0
the_img.file.maxW = 20
the_img.file.minW = 20
the_img.file.maxH = 15
the_img.file.minH = 15

the_img.file.params = -rotate 90

165 < the_img

无论“field_positiontype”的值是什么,无论如何都要构建图像。 以下是我的数据结构片段:

            <field_positiontype type="array">
                <tx_templavoila type="array">
                    <title>Position</title>
                    <sample_data type="array">
                        <numIndex index="0"></numIndex>
                    </sample_data>
                    <eType>select</eType>
                    <TypoScript></TypoScript>
                    <proc type="array">
                        <int>0</int>
                        <HSC>1</HSC>
                        <stdWrap></stdWrap>
                    </proc>
                    <preview></preview>
                </tx_templavoila>
                <TCEforms type="array">
                    <label>Position</label>
                    <config type="array">
                        <type>select</type>
                        <items type="array">
                            <numIndex index="0" type="array">
                                <numIndex index="0">Left</numIndex>
                                <numIndex index="1">left</numIndex>
                            </numIndex>
                            <numIndex index="1" type="array">
                                <numIndex index="0">Right</numIndex>
                                <numIndex index="1">right</numIndex>
                            </numIndex>
                            <numIndex index="2" type="array">
                                <numIndex index="0">Top</numIndex>
                                <numIndex index="1">top</numIndex>
                            </numIndex>
                            <numIndex index="3" type="array">
                                <numIndex index="0">Bottom</numIndex>
                                <numIndex index="1">bottom</numIndex>
                            </numIndex>
                        </items>
                        <default>0</default>
                    </config>
                </TCEforms>
            </field_positiontype>   
            <field_content type="array">
                <tx_templavoila type="array">
                    <title>Text</title>
                    <sample_data type="array">
                        <numIndex index="0"></numIndex>
                    </sample_data>
                    <eType>rte</eType>
                    <TypoScript><![CDATA[

the_img = IMG_RESOURCE
the_img.if.equals.field = field_positiontype
the_img.if.value = top

the_img.file.XY = 200,150
the_img.file.import = uploads/tx_templavoila/
the_img.file.import.field = field_tabimage
the_img.file.import.listNum = 0
the_img.file.maxW = 20
the_img.file.minW = 20
the_img.file.maxH = 15
the_img.file.minH = 15

the_img.file.params = -rotate 90

165 < the_img





                            ]]></TypoScript>
                    <proc type="array">
                        <HSC type="integer">0</HSC>
                    </proc>
                </tx_templavoila>
                <TCEforms type="array">
                    <config type="array">
                        <type>text</type>
                        <cols>48</cols>
                        <rows>5</rows>
                    </config>
                    <label>Text</label>
                    <defaultExtras>richtext:rte_transform[flag=rte_enabled|mode=ts_css]</defaultExtras>
                </TCEforms>
            </field_content>

1 个答案:

答案 0 :(得分:1)

尝试使用IMG_RESOURCE的stdWrap-Property:

the_img = IMG_RESOURCE
the_img.stdWrap.if.equals.field = field_positiontype
the_img.stdWrap.if.value = top

这应该有用, elbachata