Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/barraponto/composed_field
https://github.com/barraponto/composed_field
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/barraponto/composed_field
- Owner: barraponto
- Created: 2014-03-24T18:44:30.000Z (almost 11 years ago)
- Default Branch: deliver
- Last Pushed: 2014-03-24T21:56:14.000Z (almost 11 years ago)
- Last Synced: 2024-04-15T12:50:54.513Z (9 months ago)
- Language: PHP
- Size: 156 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.txt
Awesome Lists containing this project
README
Composed Field is an implementation of core's Field UI that allows you to split
a single field into as many sub-fields as you like.You can configure each sub-field types and attributes as they were literally a
single field.
All the Form Controls are configurable through the Field Widget Form.--- Features ---
* Each sub-field element type can be individually set to:
checkbox, checkboxes, date, fieldset, file, machine_name, managed_file,
password, password_confirm, radio, radios, select, tableselect, text_format,
textarea, textfield, vertical_tabs, weight.* The following field display settings are available:
Unformatted list (Default), Fieldset, HTML list, Table, Accordion, Tabs, Dialog
--- How does it work? ---
Each field stores its value as a serialized array into the database. Each array
element represents the sub-field value.For instance:
Say you have a field for collecting phone numbers, the phone number field
element will have these sub-fields:Landline/Mobile (select options) | Country Code (select options) | Area Code
(select options) | Number (textfield)The sub-fields values will be lumped together into an array like this:
array(
[1] => 'landline', // Landline / Mobile sub-field.
[2] => '55', // Country code sub-field.
[3] => '66', // Area code sub-field.
[4] => '3521-5555', // Number sub-field.
);After that the array is serialized and stored into the database as a single
value.--- Similar Module ---
Double Field is limited to 2 sub-fields only and each sub-field only supports
textfield, select list, single checkbox and textarea types.Composed Fields supports an unlimited number of sub-fields and each sub-field
can be set with any of the element types listed in Form Controls--- How to use ---
Once you enable this module you will have a new "Type of data to store" called
Composed Field at the Field UI.You should also give permission to trusted roles for entering PHP code into the
sub-field attributes that requires it so for functioning.