2015-05-18 83 views
1

是否可以通過FlexForm將內聯複選框顯示在彼此後面?我現在使用下面的代碼,但是它顯示了垂直列表中的每個設置。顯示Typo3 FlexForm複選框項目內聯

   <settings.ownchoice_for_sale>     
        <TCEforms> 
         <label>For sale</label> 
         <config> 
          <type>check</type> 
         </config> 
        </TCEforms> 
       </settings.ownchoice_for_sale> 
       <settings.ownchoice_reserved>     
        <TCEforms> 
         <label>Reserved</label> 
         <config> 
          <type>check</type> 
         </config> 
        </TCEforms> 
       </settings.ownchoice_reserved>     
+0

所以你的意思是,如果你檢查「ownchoice_for_sale」的形式被重新加載和「ownchoice_reserved」是顯示? 'inline'代表「內聯關係記錄編輯(IRRE)」,參見http://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Inline/Index.html –

+0

不,我的意思是顯示選項內嵌在表單中。因此,彼此背後而不是彼此之上。 – Tom

+0

好的我已經回答了你的問題。祝你好運! :) –

回答

2

Flexforms不支持諸如TCA提供的功能,例如palette

您可以使用multiple value selector在單個字段中提供所有可用選項,而不是使用checkboxes(請參閱:http://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Select/Index.html#columns-select-examples-multiple)。

你的情況,這方面的例子:

<settings.ownchoice> 
    <TCEforms> 
    <label>Own Choice</label> 
    <config> 
     <type>select</type> 
     <items> 
     <numIndex index="0"> 
      <numIndex index="0">For Sale</numIndex> 
      <numIndex index="1">for_sale</numIndex> 
     </numIndex> 
     <numIndex index="1"> 
      <numIndex index="0">Reserved</numIndex> 
      <numIndex index="1">for_sale</numIndex> 
     </numIndex> 
     </items> 
     <size>10</size> 
     <minitems>0</minitems> 
     <maxitems>100</maxitems> 
     <suppress_icons>1</suppress_icons> 
    </config> 
    </TCEforms> 
</settings.ownchoice> 

而在你的控制器:

$options = ($this->settings['ownchoice'] ? \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->settings['ownchoice']) : array()); 

if (in_array('for_sale', $options)) { 
    // option 'for_sale' is selected 
} 
+0

非常傷心,結果是一個字符串...所以我們不能很好地處理直接在視圖中......但感謝這個解決方案!更好,然後製作3個獨立的複選框 –