Git Product home page Git Product logo

form-options-csv's Introduction

Import CSV data for form select options

Important information

There's currently a core bug in ArrayUtility which makes an implicit type cast and therefor no integer or float values are possible as checked/selected default values. See https://forge.typo3.org/issues/86938 for more information.

So the examples below are only correct after this bug is fixed.

The current result would be that only "Level 4" will get checked/selected as default, because it has a string as value.

What does it do?

The extension adds a new field to the following elements:

  • Single select
  • Multi select
  • Multi checkbox

(all elements where there's a Choices field)

Backend form

You can insert CSV data (see below for possible format and options) in this field. If you save the element, the CSV data is imported as Choices rows.

Backend form after import

(see below for the given data for this result)

Installation

Require via composer

composer require "plan2net/form-options-csv"

and activate the extension through the Extension manager.

Possible values in the import field

1: Label 1;1;1
2: Label 2;2
3: Label 3
4: Label 4;;1
5: "Label with ; works too";5;1
  1. Label is set to 'Label 1', value is set to '1' and the option is selected as default
  2. Label is set to 'Label 2', value is set to '2'
  3. Label and value are set to 'Label 3'
  4. Label and value are set to 'Label 4' and the option is set as default
  5. Escape the label with "" (CSV standard) and you can use ; in the text too

The import field is cleared after the form element is saved.

For single select values only the first entry with a selected option is set and ignored for all other entries.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.