Feature #35670

Add flexform configuration as a file

Added by Chris Mueller about 1 year ago. Updated 10 months ago.

Status:Closed Start date:2012-04-04
Priority:Should have Due date:
Assignee:Arno Dudek % Done:

0%

Category:- Spent time: -
Target version:-
TYPO3 Version: PHP Version:
Votes: 1 (View)

Description

It would be nice, if it is possible to add the flexform configuration of a CE backend layout as a file reference instead as editing in the field. So you can take this configuration under version control.

Attached is a patch to make this true.

In the patch a new field "pi_flexform_ds_file" is introduced. If both fields are filled (pi_flexform_ds and pi_flexform_ds_file), the pi_flexform_ds field has the priority.

It would be nice if this feature request finds its way into the next version.

gridelements_flexform_file_v1.diff (5.4 kB) Chris Mueller, 2012-04-04 11:28

gridelements_flexform_file_v2.diff (1.1 kB) Chris Mueller, 2012-04-05 08:41

History

Updated by Arno Dudek about 1 year ago

Do you know already the fueature to make the settings in TSconfig? #31046
So it's possible to reference to a file with <INCLUDE_TYPOSCRIPT *>

Updated by Chris Mueller about 1 year ago

Thanks for the hint, the pageTS is very useful. But it would be great if I could reference a valid xml file as reference for the "flexformDS" property. Something like:
tx_gridelements.setup.1.flexformDS.file = fileadmin/path/to/somewhere/flexform.xml

With <INCLUDE_TYPOSCRIPT ...> I always have to wrap the xml with the tx_gridelements.setup.1.flexformDS property, isn't it? An additional "file" property would be a cleaner approach. What do you think?

Updated by Arno Dudek about 1 year ago

  • Status changed from New to Accepted
  • Assignee set to Jo Hasenau

@Chris
Not tested!!! Please do if implemented.

@Jo
Hi Jo!

Can you please implement this feature to the file

class.tx_gridelements_tceformshook.php line 37

replace

            if ($layoutSetup['pi_flexform_ds']) {
                $parentObject['fieldConf']['config']['ds']['*,gridelements_pi1'] = $layoutSetup['pi_flexform_ds'];


with
            if ($layoutSetup['pi_flexform_ds']) {
                $flexformDS = $layoutSetup['pi_flexform_ds'];
                if (strpos($layoutSetup['pi_flexform_ds'], 'FILE:') === 0) {
                    $flexformPathAndFileName = substr($layoutSetup['pi_flexform_ds'], 5);
                    $flexformDS = t3lib_div::getURL(t3lib_div::getFileAbsFileName(substr($layoutSetup['pi_flexform_ds'], 5)));
                }
                $parentObject['fieldConf']['config']['ds']['*,gridelements_pi1'] = $flexformDS;

With this it's possible to set the TSconfig property

tx_gridelements.setup.1.flexformDS = FILE:fileadmin/path/to/somewhere/flexform.xml

And it should also be possible to set it in the record. It recordnize the first letters, and if they are "FILE:" the file will be loaded.

Thanks!
lg arno

Updated by Jo Hasenau about 1 year ago

Hi Arno.

IIRC you are a member of this team - so you don't have to ask for implementation.
Just commit your stuff, and if it works well, it will be part of the next version uploaded to the TER.

Cheers

Joey

Updated by Arno Dudek about 1 year ago

Yes, I know. But a time ago I made some changes and they was overridden again or be ignored ;)

It was a mistake, not intended.

will do it next week.

Updated by Chris Mueller about 1 year ago

Hi Arno,

I made a patch (gridelements_flexform_file_v2.diff) on your proposal. Additionally I added a check, if the file exists.

I tested also the following conditions:
  • Flexform not defined
  • Flexform in pageTS
  • Flexform with a file reference (FILE:)
  • Flexform with a wrong file reference (file does not exists)

I'm looking forward to see it in the next release :)

Chris.

Updated by Ralf-Rene Schroeder about 1 year ago

+1 from me
would be a very nice feature
patch testet localy - works fine

Updated by Arno Dudek about 1 year ago

Oh! Thank you very much!

Updated by Arno Dudek about 1 year ago

  • Status changed from Accepted to Needs Feedback

@Chris

Hi! I saw you want a file field for this feature. Dou you really want this? The file will be saved and if it changed it would not be updated until you upload it again. But it will if we use "FILE:" in the configuration field.

Updated by Chris Mueller about 1 year ago

@Arno

I'm with you, that's why I uploaded the second patch (v2) with your suggestion. This implements the FILE: feature. It would be nice if it find its way into the next version.

Updated by Arno Dudek about 1 year ago

  • Status changed from Needs Feedback to Closed

Updated by Ralf-Rene Schroeder 10 months ago

  • Assignee changed from Jo Hasenau to Arno Dudek

Question:
With this solution in the trunk it only works when i put the FILE:fileadmin/... in the flexform field, but not in TypoScript, is that right???
But this possibility would be a "should have", because of using constants in the path to the file!

Updated by Arno Dudek 10 months ago

The configuration with TypoScript will happens in the pageTSconfig not TSsetup. There you can't use constants.

lg arno

Also available in: Atom PDF