Project

General

Profile

Actions

Feature #33390

closed

displayCond for sheets in flexforms

Added by Anonymous over 12 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-01-23
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

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

patch (1.06 KB) patch Anonymous, 2012-01-23 16:07
flexform_ds.xml (4.32 KB) flexform_ds.xml tt_news flexform Anonymous, 2012-01-24 17:12
displayCond_for_sheets_in_flexforms.patch (1.09 KB) displayCond_for_sheets_in_flexforms.patch Sebastijan , 2012-04-08 19:53

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #68493: DisplayCond for sheets in flexforms should allow extbase parameters "settings."ClosedBenjamin Serfhos2015-07-23

Actions
Actions #1

Updated by Ernesto Baschny over 12 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. ;)

Actions #2

Updated by Gerrit Code Review over 12 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

Actions #3

Updated by Anonymous over 12 years ago

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.

Actions #4

Updated by Gerrit Code Review over 12 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/8677

Actions #5

Updated by Anonymous over 12 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #6

Updated by Sebastijan over 12 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);

Actions #7

Updated by Gone With the Wind almost 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!

Actions #8

Updated by Daniel Siepmann about 11 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>

Actions #9

Updated by Gone With the Wind about 11 years ago

Thank you, Daniel, for the info and the sample! Works "like a charm", as they say :-)

Actions #10

Updated by Benni Mack almost 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF