Project

General

Profile

Actions

Feature #93099

closed

Allow usage of commaseparated list in for-Viewhelper in Fluid

Added by Dieter Porth almost 4 years ago. Updated almost 4 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2020-12-17
Due date:
% Done:

0%

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

Description

I use flex-field, to define some static datas für my content-Element.
I use a select-field with renderType selectMultipleSideBySide in my flexform.
I get a comma-separated list.

It would be fine, if the for-Viewhelper could manage comma-separated lists.

I added a patch for a better for-viewhelper.

Suggestion in patch1:
You can use the setting of the delimiter as a needed flag, to analyse a string. Then the programmer must define a delimiter, if he wants that his for-viewhelper should explode a string to an array, if a string is given.


Files

local_history.patch (1.62 KB) local_history.patch Dieter Porth, 2020-12-17 14:41
local_history1.patch (11.3 KB) local_history1.patch Dieter Porth, 2020-12-17 14:53
Actions #1

Updated by Dieter Porth almost 4 years ago

I forgot the parameter each in the registration.
array must converted to mixed .

Actions #2

Updated by Christoph Lehmann almost 4 years ago

I would use an explode ViewHelper for this:

https://viewhelpers.fluidtypo3.org/fluidtypo3/vhs/1.3.2/Iterator/Explode.html

The ViewHelper can create an array from a comma separated list.

Actions #3

Updated by Georg Ringer almost 4 years ago

  • Status changed from New to Rejected

Thanks for creating this issue and feature request.

We try hard to remove such type mixture where one variable can be a string or or an array. Edge cases which need to be solved when having string are:

  • which char is used for separating? So another option is needed
  • should the items be trimmed or not? Another option needed.

As pointed out, please transform the string yourself with mentioned ViewHelper or an own one.

Actions

Also available in: Atom PDF