Feature #33390
closed
displayCond for sheets in flexforms
100%
Description
would be nice to be able to determine whether a flexform sheet will be display or not via displayCond. This currently only works for fields and is checking for field values is limited to those of the same sheet.
just like accessing the values of fields from the same sheet for a field:
<displayCond>FIELD:view:=:list</displayCond>
or fields of the tt_content record:
<displayCond>FIELD:parentRec.fieldXYZ:=:valueXYZ</displayCond>
there should be a possibility to check on specific fields of specific sheets for sheets:
<displayCond>FIELD:sDEF.view:=:list</displayCond>
the attached patch file is just a little hack to demonstrate the feature. it covers scenarios like:
<sDEF> ... </sDEF <sheet1> <ROOT> <TCEforms> <sheetTitle>My optional Sheet</sheetTitle> <displayCond>FIELD:sDEF.view:=:list</displayCond> </TCEforms> <el> ...
Files
Updated by Ernesto Baschny about 13 years ago
- Status changed from New to Accepted
Sounds nice!
As it's a new feature, it has to be a patch for "master" only.
Since 4.7's feature freeze is Feb 12th, time is running low for getting it in. If you are happy with your patch yet, make sure to submit it to gerrit and do some "lobby" work to get some reviews. ;)
Updated by Gerrit Code Review about 13 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/8677
Updated by Anonymous about 13 years ago
- File flexform_ds.xml flexform_ds.xml added
here's a flexform that uses those new displayCond's. I just used tt_news' flexform. For testing you simply have to replace it with this file.
Updated by Gerrit Code Review about 13 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/8677
Updated by Anonymous about 13 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 0004f248ce68fc47b7ba029496eb15a448592604.
Updated by Sebastijan almost 13 years ago
This only work for one condition on only one sheet.
The problem is the following:
If you have four sheets, $tabParts have indexes 0,1,2,3.
If you set value, where only first and second (sheets with index 0 and 1) should be visible, visible are 0,1 and 3.
When you delete sheet with index 2, the max index in array tabParts remains 2.
When you typo insert new sheet, new sheet is inserted at index 3. So when you try to execute:
unset($tabParts[count($tabParts)-1]);
It tries to unset item at index 2, but the item is at index 3.
The possible solution is:
$tabParts = array_slice($tabParts, 0, count($tabParts)-1);
Updated by Gone With the Wind over 12 years ago
What is the status quo of this feature? Didn't see it in TYPO3 4.7, neither in TYPO3 4.6 nor TYPO3 4.5 (which is the targeted version), or did I miss something?
Is there anywhere a "lobby" going on? Would be great to have that feature!
Thanks for the info!
Updated by Daniel Siepmann almost 12 years ago
It's there Robert, take a look at /t3lib/class.t3lib_tceforms.php:2527 in Ver 4.7.12.
Usage is e.g:
<?xml version="1.0" encoding="UTF-8"?> <T3DataStructure> <meta> <langDisable>1</langDisable> </meta> <sheets> <General> <ROOT> <TCEforms> <sheetTitle>LLL:EXT:EXTKEY/Resources/Private/Language/locallang.xlf:conf.tab.general</sheetTitle> </TCEforms> <type>array</type> <el> <switchableControllerActions> <TCEforms> <label>LLL:EXT:EXTKEY/Resources/Private/Language/locallang.xlf:conf.action</label> <config> <type>select</type> <items type="array"> <numIndex index="0"> <numIndex index="0">LLL:EXT:EXTKEY/Resources/Private/Language/locallang.xlf:general.ActionOne</numIndex> <numIndex index="1">Controller->action</numIndex> </numIndex> </items> <size>1</size> </config> </TCEforms> </switchableControllerActions> </el> </ROOT> </General> <FilterAndSorting> <ROOT> <TCEforms> <sheetTitle>LLL:EXT:EXTKEY/Resources/Private/Language/locallang.xlf:conf.tab.filter_and_sorting</sheetTitle> <displayCond>FIELD:General.switchableControllerActions:=:Controller->Action</displayCond> </TCEforms> <type>array</type> <el> <settings.sorting> ... </settings.sorting> </el> </ROOT> </FilterAndSorting> </sheets> </T3DataStructure>
Updated by Gone With the Wind over 11 years ago
Thank you, Daniel, for the info and the sample! Works "like a charm", as they say :-)