开发者

TYPO3 - TypoScript condition

开发者 https://www.devze.com 2023-02-11 16:11 出处:网络
Im trying to use a condition on an IMG_RESOURCE in my datastructure. But the problem is that this part does not seem to work:

Im trying to use a condition on an IMG_RESOURCE in my datastructure. But the problem is that this part does not seem to work:

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

No matter what the value of "field_positiontype" is, the image is build anyway. Here are a snippet of my data structure:

            <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开发者_JAVA技巧>
                        </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>


Try to use the IMG_RESOURCE's stdWrap-Property:

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

This should work, elbachata

0

精彩评论

暂无评论...
验证码 换一张
取 消