2011-02-18 73 views
1

我試圖在數據結構中使用IMG_RESOURCE上的條件。但問題是,這部分似乎並沒有工作:Typo3 - Typoscript條件

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> 
+0

這是一個非常奇怪的行爲,我在德國文件中看到if條件被置於底部。 – Rito 2011-02-22 10:22:20

回答

1

嘗試使用IMG_RESOURCE的stdWrap-物業:

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

這應該工作, elbachata