2011-02-18 3 views
1

J'essaie d'utiliser une condition sur une IMG_RESOURCE dans ma structure de données. Mais le problème est que cette partie ne semble pas fonctionner:Typo3 - Condition de 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 

Quelle que soit la valeur de « field_positiontype » est, l'image est construite de toute façon. Voici un extrait de ma structure de données:

  <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

c'est un comportement vraiment bizarre, je J'ai vu dans les docs allemands que la condition if est placée en bas. – Rito

Répondre

1

Essayez d'utiliser stdWrap la propriété du IMG_RESOURCE:

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

Cela devrait fonctionner, elbachata

Questions connexes