diff --git a/docs/content_management/field_types/field_type_reference/addressfield.md b/docs/content_management/field_types/field_type_reference/addressfield.md index 9f6d49e201..ffc5be226e 100644 --- a/docs/content_management/field_types/field_type_reference/addressfield.md +++ b/docs/content_management/field_types/field_type_reference/addressfield.md @@ -121,7 +121,7 @@ class ExampleAddressSubscriber implements EventSubscriberInterface 'ibexa.address.field.tax_number.billing_address' => 'onBillingAddressTaxNumber', ]; } - + public function onBillingAddressTaxNumber(MapFieldEvent $event): void { $event->setLabel('VAT'); diff --git a/docs/content_management/field_types/field_type_reference/authorfield.md b/docs/content_management/field_types/field_type_reference/authorfield.md index d3097aea82..c26c2dcb11 100644 --- a/docs/content_management/field_types/field_type_reference/authorfield.md +++ b/docs/content_management/field_types/field_type_reference/authorfield.md @@ -2,9 +2,9 @@ This field type allows the storage and retrieval of one or more authors. For each author, it can handle a name and an email address. It's typically used to store information about additional authors who have written/created different parts of a content item. -| Name | Internal name | Expected input | Output | -|----------|---------------|----------------|----------| -| `Author` | `ezauthor` | mixed | `string` | +| Name | Internal name | Expected input | Output | +|----------|----------------|----------------|----------| +| `Author` | `ibexa_author` | mixed | `string` | ## PHP API field type @@ -12,9 +12,9 @@ This field type allows the storage and retrieval of one or more authors. For eac ##### Properties -|Attribute|Type|Description|Example| -|------|------|------|------| -|`authors`|`\Ibexa\Core\FieldType\Author\Author[] `|List of authors.|See below| +| Attribute | Type | Description | Example | +|-----------|------------------------------------------|------------------|-----------| +| `authors` | `\Ibexa\Core\FieldType\Author\Author[] ` | List of authors. | See below | Example: @@ -68,16 +68,16 @@ This field type doesn't perform any special validation of the input value. The Field definition of this field type can be configured with a single option: -|Name|Type|Default value|Description| -|------|------|------|------| -|`defaultAuthor`|`mixed`|`Type::DEFAULT_VALUE_EMPTY`|One of the `DEFAULT_*` constants, used by the administration interface for setting the default Field value. See below for more details.| +| Name | Type | Default value | Description | +|-----------------|---------|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------| +| `defaultAuthor` | `mixed` | `Type::DEFAULT_VALUE_EMPTY` | One of the `DEFAULT_*` constants, used by the administration interface for setting the default Field value. See below for more details. | -Following `defaultAuthor` default value options are available as constants in the `Ibexa\Core\FieldType\Author\Type` class: +Following `defaultAuthor` default value options are available as constants in the `Ibexa\Core\FieldType\Author\Type` class: -|Constant|Description| -|------|------| -|`DEFAULT_VALUE_EMPTY`|Default value is empty.| -|`DEFAULT_CURRENT_USER`|Default value uses currently logged user.| +| Constant | Description | +|------------------------|-------------------------------------------| +| `DEFAULT_VALUE_EMPTY` | Default value is empty. | +| `DEFAULT_CURRENT_USER` | Default value uses currently logged user. | ``` php // Author field type example settings diff --git a/docs/content_management/field_types/field_type_reference/binaryfilefield.md b/docs/content_management/field_types/field_type_reference/binaryfilefield.md index 974717146d..3b7d612234 100644 --- a/docs/content_management/field_types/field_type_reference/binaryfilefield.md +++ b/docs/content_management/field_types/field_type_reference/binaryfilefield.md @@ -5,9 +5,9 @@ This field type represents and handles a single binary file. It also counts the It's capable of handling virtually any file type and is typically used for storing legacy document types, for example, PDF files, Word documents, or spreadsheets. The maximum allowed file size is determined by the "Max file size" class attribute edit parameter and the `upload_max_filesize` directive in the main PHP configuration file (`php.ini`). -| Name | Internal name | Expected input | Output | -|--------------|----------------|----------------|---------| -| `BinaryFile` | `ezbinaryfile` | mixed | mixed | +| Name | Internal name | Expected input | Output | +|--------------|--------------------|----------------|---------| +| `BinaryFile` | `ibexa_binaryfile` | mixed | mixed | ## PHP API field type @@ -19,15 +19,15 @@ Both `BinaryFile` and `Media` Value and Type inherit from the `BinaryBase` abstr `Ibexa\Core\FieldType\BinaryFile\Value` offers the following properties: -|Attribute|Type|Description|Example| -|------|------|------|------| -|`id`|string|Binary file identifier. This ID depends on the [IO Handler](clustering.md#dfs-io-handler) that is being used. With the native, default handlers (FileSystem and Legacy), the ID is the file path, relative to the binary file storage root dir (`var//storage/original` by default).|application/63cd472dd7.pdf| -|`fileName`|string|The human-readable file name, as exposed to the outside. Used when sending the file for download to name the file.|20130116_whitepaper.pdf| -|`fileSize`|int|File size, in bytes.|1077923| -|`mimeType`|string|The file's MIME type.|application/pdf| -|`uri`|string|The binary file's `content/download` URI. If the URI doesn't include a host or protocol, it applies to the request domain.|/content/download/210/2707| -|`downloadCount`|integer|Number of times the file was downloaded|0| -|`inputUri`|string|Path to a local file when creating a field value, `null` when reading a field value|`path/to/document.pdf`| +| Attribute | Type | Description | Example | +|-----------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------| +| `id` | string | Binary file identifier. This ID depends on the [IO Handler](clustering.md#dfs-io-handler) that is being used. With the native, default handlers (FileSystem and Legacy), the ID is the file path, relative to the binary file storage root dir (`var//storage/original` by default). | application/63cd472dd7.pdf | +| `fileName` | string | The human-readable file name, as exposed to the outside. Used when sending the file for download to name the file. | 20130116_whitepaper.pdf | +| `fileSize` | int | File size, in bytes. | 1077923 | +| `mimeType` | string | The file's MIME type. | application/pdf | +| `uri` | string | The binary file's `content/download` URI. If the URI doesn't include a host or protocol, it applies to the request domain. | /content/download/210/2707 | +| `downloadCount` | integer | Number of times the file was downloaded | 0 | +| `inputUri` | string | Path to a local file when creating a field value, `null` when reading a field value | `path/to/document.pdf` | #### Constructor's hash format diff --git a/docs/content_management/field_types/field_type_reference/checkboxfield.md b/docs/content_management/field_types/field_type_reference/checkboxfield.md index 1e697f5e7f..54380b2469 100644 --- a/docs/content_management/field_types/field_type_reference/checkboxfield.md +++ b/docs/content_management/field_types/field_type_reference/checkboxfield.md @@ -2,11 +2,11 @@ The Checkbox field type stores the current status for a checkbox input, checked or unchecked, by storing a boolean value. -| Name | Internal name | Expected input type | -|------------|---------------|---------------------| -| `Checkbox` | `ezboolean` | `boolean` | +| Name | Internal name | Expected input type | +|------------|-----------------|---------------------| +| `Checkbox` | `ibexa_boolean` | `boolean` | -## PHP API field type  +## PHP API field type ### Value object @@ -14,17 +14,17 @@ The Checkbox field type stores the current status for a checkbox input, checked The Value class of this field type contains the following properties: -| Property | Type | Default value | Description| -|----------|-----------|---------------|------------| +| Property | Type | Default value | Description | +|----------|-----------|---------------|--------------------------------------------------------------------------------| | `$bool` | `boolean` | `false` | This property is used for the checkbox status, represented by a boolean value. | ``` php //Value object content examples use Ibexa\Core\FieldType\Checkbox\Type; -  + // Instantiates a checkbox value with a default state (false) $checkboxValue = new Checkbox\Value(); -  + // Checked $value->bool = true; @@ -34,12 +34,12 @@ $value->bool = false; ##### Constructor -The `Checkbox\Value` constructor accepts a boolean value: +The `Checkbox\Value` constructor accepts a boolean value: ``` php // Constructor example use Ibexa\Core\FieldType\Checkbox\Type; -  + // Instantiates a checkbox value with a checked state $checkboxValue = new Checkbox\Value( true ); ``` diff --git a/docs/content_management/field_types/field_type_reference/contentqueryfield.md b/docs/content_management/field_types/field_type_reference/contentqueryfield.md index 6d5da60186..4aaab24ce5 100644 --- a/docs/content_management/field_types/field_type_reference/contentqueryfield.md +++ b/docs/content_management/field_types/field_type_reference/contentqueryfield.md @@ -2,9 +2,9 @@ This field type maps an executable repository query to a field. -| Name | Internal name | Expected input | -|-----------|---------------|----------------| -| `Content query` | `ezcontentquery` | `string` | +| Name | Internal name | Expected input | +|---------|-----------------------|----------------| +| `Query` | `ibexa_content_query` | `string` | The Content query field type is available via the Query field type Bundle provided by the [fieldtype-query](https://github.com/ibexa/fieldtype-query) package. diff --git a/docs/content_management/field_types/field_type_reference/countryfield.md b/docs/content_management/field_types/field_type_reference/countryfield.md index 93d7e219a8..521b06bd94 100644 --- a/docs/content_management/field_types/field_type_reference/countryfield.md +++ b/docs/content_management/field_types/field_type_reference/countryfield.md @@ -2,11 +2,11 @@ This field type represents one or multiple countries. -| Name | Internal name | Expected input | -|-----------|---------------|----------------| -| `Country` | `ezcountry` | `array` | +| Name | Internal name | Expected input | +|-----------|-----------------|----------------| +| `Country` | `ibexa_country` | `array` | -## PHP API field type  +## PHP API field type ### Input expectations @@ -33,8 +33,8 @@ This field type validates whether multiple countries are allowed by the field de The field definition of this field type can be configured with one option: -| Name | Type | Default value | Description| -|--------------|-----------|---------------|------------| +| Name | Type | Default value | Description | +|--------------|-----------|---------------|--------------------------------------------------------------------------------------------| | `isMultiple` | `boolean` | `false` | This setting allows (if true) or prohibits (if false) the selection of multiple countries. | ``` php @@ -62,8 +62,8 @@ The format used by the toHash method is the Alpha2 value, however the input is c The Value class of this field type contains the following properties: -| Property | Type | Description| -|--------------|-----------|------------| +| Property | Type | Description | +|--------------|-----------|---------------------------------------------------------------------------------------| | `$countries` | `array[]` | This property is used for the country selection provided as input, as its attributes. | ``` php @@ -80,7 +80,7 @@ $value->countries = [ ##### Constructor -The `Country\Value` constructor initializes a new value object with the value provided. +The `Country\Value` constructor initializes a new value object with the value provided. It expects an array as input. ``` php diff --git a/docs/content_management/field_types/field_type_reference/customergroupfield.md b/docs/content_management/field_types/field_type_reference/customergroupfield.md index 6cd3d118dd..5e01db8d30 100644 --- a/docs/content_management/field_types/field_type_reference/customergroupfield.md +++ b/docs/content_management/field_types/field_type_reference/customergroupfield.md @@ -2,9 +2,9 @@ This field type represents a customer group that a user belongs to. -| Name | Internal name | Expected input type | -|--------|---------------|---------------------| -| `Customer group` | `ibexa_customer_group` | `int` or null | +| Name | Internal name | Expected input type | +|------------------|------------------------|---------------------| +| `Customer group` | `ibexa_customer_group` | `int` or null | ## PHP API field type @@ -14,6 +14,6 @@ This field type represents a customer group that a user belongs to. The Value class of this field type contains the following properties: -| Property | Type | Description| -|----------|----------|------------| -| `$id` | `int` | ID of the customer group. | +| Property | Type | Description | +|----------|---------|---------------------------| +| `$id` | `int` | ID of the customer group. | diff --git a/docs/content_management/field_types/field_type_reference/dateandtimefield.md b/docs/content_management/field_types/field_type_reference/dateandtimefield.md index 6b30bd1780..d0d5e3fd25 100644 --- a/docs/content_management/field_types/field_type_reference/dateandtimefield.md +++ b/docs/content_management/field_types/field_type_reference/dateandtimefield.md @@ -2,11 +2,11 @@ This field type represents a full date and time information. -| Name | Internal name | Expected input type | -|---------------|---------------|---------------------| -| `DateAndTime` | `ezdatetime` | mixed | +| Name | Internal name | Expected input type | +|---------------|-------------------|---------------------| +| `DateAndTime` | `ibexa_datetime` | mixed | -## PHP API field type  +## PHP API field type ### Input expectations @@ -14,11 +14,11 @@ If input value is of type `string` or `integer`, it's passed directly to the [PH It's also possible to directly pass an instance of `\DateTime`. -|Type|Example| -|------|------| -|`integer`|`"2017-08-28 12:20 Europe/Berlin"`| -|`integer`|`1346149200`| -|`\DateTime`|`new \DateTime()`| +| Type | Example | +|-------------|------------------------------------| +| `integer` | `"2017-08-28 12:20 Europe/Berlin"` | +| `integer` | `1346149200` | +| `\DateTime` | `new \DateTime()` | ### Value object @@ -32,21 +32,21 @@ The Value class of this field type contains the following properties: ##### Constructor -The constructor for this value object initializes a new value object with the value provided. It accepts an instance of PHP's built-in `\DateTime` class. +The constructor for this value object initializes a new value object with the value provided. It accepts an instance of PHP's built-in `\DateTime` class. ##### String representation -String representation of the date value generates the date string in the format `D Y-d-m H:i:s` as accepted by [PHP's built-in `date()` function](https://www.php.net/manual/en/function.date.php). +String representation of the date value generates the date string in the format `D Y-d-m H:i:s` as accepted by [PHP's built-in `date()` function](https://www.php.net/manual/en/function.date.php). -|Character|Description|Example| -|---------|----------|--------| -|D|Three letter representation of a day, range Mon to Sun|Wed| -|Y|Four digit representation of a year|2016| -|d|Two digit representation of a day, range 01 to 31|22| -|m|Two digit representation of a month, range 01 to 12|05| -|H|Two digit representation of an hour, 24-hour format, range 00 to 23 |12| -|i|Two digit representation of minutes, range 00 to 59|19| -|s|Two digit representation of seconds, range 00 to 59|18| +| Character | Description | Example | +|-----------|---------------------------------------------------------------------|---------| +| D | Three letter representation of a day, range Mon to Sun | Wed | +| Y | Four digit representation of a year | 2016 | +| d | Two digit representation of a day, range 01 to 31 | 22 | +| m | Two digit representation of a month, range 01 to 12 | 05 | +| H | Two digit representation of an hour, 24-hour format, range 00 to 23 | 12 | +| i | Two digit representation of minutes, range 00 to 59 | 19 | +| s | Two digit representation of seconds, range 00 to 59 | 18 | Example: `Wed 2016-22-05 12:19:18` @@ -54,10 +54,10 @@ Example: `Wed 2016-22-05 12:19:18` Hash value of this field type is an array with two keys: -|Key|Type| Description |Example| -|------|------|---------------------------------------------------------------------------------------------------------------------------------------------------------|------| -|`timestamp`|`integer`| Time information in [Unix format timestamp](https://en.wikipedia.org/wiki/Unix_time). |`1400856992`| -|`rfc850`|`string`| Time information as a string in [RFC 850 date format](https://datatracker.ietf.org/doc/html/rfc850). As input, this has precedence over the timestamp value. |`"Friday, 23-May-14 14:56:14 GMT+0000"`| +| Key | Type | Description | Example | +|-------------|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------| +| `timestamp` | `integer` | Time information in [Unix format timestamp](https://en.wikipedia.org/wiki/Unix_time). | `1400856992` | +| `rfc850` | `string` | Time information as a string in [RFC 850 date format](https://datatracker.ietf.org/doc/html/rfc850). As input, this has precedence over the timestamp value. | `"Friday, 23-May-14 14:56:14 GMT+0000"` | ``` php $hash = [ @@ -74,19 +74,19 @@ This field type doesn't perform any special validation of the input value. The field definition of this field type can be configured with several options: -|Name|Type|Default value|Description| -|------|------|------|------| -|`useSeconds`|`boolean`|`false`|Used to control displaying of seconds in the output.| -|`defaultType`|`mixed`|`Type::DEFAULT_EMPTY`|One of the `DEFAULT_*` constants, used by the administration interface for setting the default field value. See below for more details.| -|`dateInterval`|`null|\DateInterval`|`null`|This setting complements `defaultType` setting and can be used only when the latter is set to `Type::DEFAULT_CURRENT_DATE_ADJUSTED`. In that case the default input value when using administration interface is adjusted by the given `\DateInterval`.| +| Name | Type | Default value | Description | +|----------------|-----------|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------| +| `useSeconds` | `boolean` | `false` | Used to control displaying of seconds in the output. | +| `defaultType` | `mixed` | `Type::DEFAULT_EMPTY` | One of the `DEFAULT_*` constants, used by the administration interface for setting the default field value. See below for more details. | +| `dateInterval` | `null | \DateInterval` | `null` |This setting complements `defaultType` setting and can be used only when the latter is set to `Type::DEFAULT_CURRENT_DATE_ADJUSTED`. In that case the default input value when using administration interface is adjusted by the given `\DateInterval`.| -Following `defaultType` default value options are available as constants in the `Ibexa\Core\FieldType\DateAndTime\Type` class: +Following `defaultType` default value options are available as constants in the `Ibexa\Core\FieldType\DateAndTime\Type` class: -|Constant|Description| -|------|------| -|`DEFAULT_EMPTY`|Default value is empty.| -|`DEFAULT_CURRENT_DATE`|Default value uses current date.| -|`DEFAULT_CURRENT_DATE_ADJUSTED`|Default value uses current date, adjusted by the interval defined in `dateInterval` setting.| +| Constant | Description | +|---------------------------------|----------------------------------------------------------------------------------------------| +| `DEFAULT_EMPTY` | Default value is empty. | +| `DEFAULT_CURRENT_DATE` | Default value uses current date. | +| `DEFAULT_CURRENT_DATE_ADJUSTED` | Default value uses current date, adjusted by the interval defined in `dateInterval` setting. | ``` php // DateAndTime FieldType example settings @@ -102,11 +102,11 @@ $settings = [ ## Template rendering -The template called by the [`ibexa_render_field()` Twig function](field_twig_functions.md#ibexa_render_field) while rendering a Date field has access to the following parameters: +The template called by the [`ibexa_render_field()` Twig function](field_twig_functions.md#ibexa_render_field) while rendering a Date field has access to the following parameters: -| Parameter | Type | Default | Description| -|-----------|----------|---------|------------| -| `locale` | `string` |   n/a | Internal parameter set by the system based on current request locale or if not set calculated based on the language of the field. | +| Parameter | Type | Default | Description | +|-----------|----------|---------|-----------------------------------------------------------------------------------------------------------------------------------| +| `locale` | `string` | n/a | Internal parameter set by the system based on current request locale or if not set calculated based on the language of the field. | Example: diff --git a/docs/content_management/field_types/field_type_reference/datefield.md b/docs/content_management/field_types/field_type_reference/datefield.md index 8938fd704f..415f9153c4 100644 --- a/docs/content_management/field_types/field_type_reference/datefield.md +++ b/docs/content_management/field_types/field_type_reference/datefield.md @@ -4,9 +4,9 @@ This field type represents a date without time information. | Name | Internal name | Expected input type | |--------|---------------|---------------------| -| `Date` | `ezdate` | mixed | +| `Date` | `ibexa_date` | mixed | -#### PHP API field type  +#### PHP API field type ### Input expectations @@ -14,11 +14,11 @@ If input value is in `string` or `integer` format, it's passed directly to [PHP' It's also possible to directly pass an instance of `\DateTime`. -|Type|Example| -|------|------| -|`string`|`"2012-08-28 12:20 Europe/Berlin"`| -|`integer`|`1346149200`| -|`\DateTime`|`new \DateTime()`| +| Type | Example | +|-------------|------------------------------------| +| `string` | `"2012-08-28 12:20 Europe/Berlin"` | +| `integer` | `1346149200` | +| `\DateTime` | `new \DateTime()` | Time information is **not stored**. @@ -30,36 +30,36 @@ Before storing, the provided input value is set to the beginning of the day in t The Value class of this field type contains the following properties: -| Property | Type | Description| -|----------|-------------|------------| +| Property | Type | Description | +|----------|-------------|---------------------------------------------| | `$date` | `\DateTime` | This property is used for the text content. | ##### String representation -String representation of the date value generates the date string in the format "l d F Y" as accepted by [PHP's built-in `date()` function](https://www.php.net/manual/en/function.date.php). +String representation of the date value generates the date string in the format "l d F Y" as accepted by [PHP's built-in `date()` function](https://www.php.net/manual/en/function.date.php). -|Character|Description|Example| -|---------|----------|--------| -|l|Textual representation of a day of the week, range Monday to Sunday|Wednesday| -|d|Two digit representation of a day, range 01 to 31|22| -|F|Textual representation of a month, range January to December|May| -|Y|Four digit representation of a year|2016| +| Character | Description | Example | +|-----------|---------------------------------------------------------------------|-----------| +| l | Textual representation of a day of the week, range Monday to Sunday | Wednesday | +| d | Two digit representation of a day, range 01 to 31 | 22 | +| F | Textual representation of a month, range January to December | May | +| Y | Four digit representation of a year | 2016 | Example: `Wednesday 22 May 2016` ##### Constructor The constructor for this value object initializes a new value object with the value provided. -It accepts an instance of [PHP's built-in `\DateTime` class](https://www.php.net/manual/en/datetime.construct.php). +It accepts an instance of [PHP's built-in `\DateTime` class](https://www.php.net/manual/en/datetime.construct.php). ### Hash format Hash value of this field type is an array with two keys: -|Key|Type| Description |Example| -|------|------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|------| -|`timestamp`|`integer`| Time information in [unix format timestamp](https://en.wikipedia.org/wiki/Unix_time). |`1400856992`| -|`rfc850`|`string`| Time information as a string in [RFC 850 date format](https://datatracker.ietf.org/doc/html/rfc850). As input, this has higher precedence over the timestamp value. |`"Friday, 23-May-14 14:56:14 GMT+0000"`| +| Key | Type | Description | Example | +|-------------|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------| +| `timestamp` | `integer` | Time information in [unix format timestamp](https://en.wikipedia.org/wiki/Unix_time). | `1400856992` | +| `rfc850` | `string` | Time information as a string in [RFC 850 date format](https://datatracker.ietf.org/doc/html/rfc850). As input, this has higher precedence over the timestamp value. | `"Friday, 23-May-14 14:56:14 GMT+0000"` | ``` php // Example of the hash value in PHP @@ -77,16 +77,16 @@ This field type doesn't perform any special validation of the input value. The field definition of this field type can be configured with a single option: -|Name|Type|Default value|Description| -|------|------|------|------| -|`defaultType`|`mixed`|`Type::DEFAULT_EMPTY`|One of the `DEFAULT_*` constants, used by the administration interface for setting the default field value. See below for more details.| +| Name | Type | Default value | Description | +|---------------|---------|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------| +| `defaultType` | `mixed` | `Type::DEFAULT_EMPTY` | One of the `DEFAULT_*` constants, used by the administration interface for setting the default field value. See below for more details. | -Following `defaultType` default value options are available as constants in the `Ibexa\Core\FieldType\Date\Type` class: +Following `defaultType` default value options are available as constants in the `Ibexa\Core\FieldType\Date\Type` class: -|Constant|Description| -|------|------| -|`DEFAULT_EMPTY`|Default value is empty.| -|`DEFAULT_CURRENT_DATE`|Default value uses current date.| +| Constant | Description | +|------------------------|----------------------------------| +| `DEFAULT_EMPTY` | Default value is empty. | +| `DEFAULT_CURRENT_DATE` | Default value uses current date. | ``` php // Date field type example settings @@ -100,11 +100,11 @@ $settings = [ ## Template rendering -The template called by [the `ibexa_render_field()` Twig function](field_twig_functions.md#ibexa_render_field) while rendering a Date field has access to the following parameters: +The template called by [the `ibexa_render_field()` Twig function](field_twig_functions.md#ibexa_render_field) while rendering a Date field has access to the following parameters: -| Parameter | Type |Description| -|-----------|----------|------------| -| `locale` | `string` |Internal parameter set by the system based on current request locale or if not set, calculated based on the language of the field. | +| Parameter | Type | Description | +|-----------|----------|------------------------------------------------------------------------------------------------------------------------------------| +| `locale` | `string` | Internal parameter set by the system based on current request locale or if not set, calculated based on the language of the field. | Example: diff --git a/docs/content_management/field_types/field_type_reference/emailaddressfield.md b/docs/content_management/field_types/field_type_reference/emailaddressfield.md index a23a84885f..db376e9eee 100644 --- a/docs/content_management/field_types/field_type_reference/emailaddressfield.md +++ b/docs/content_management/field_types/field_type_reference/emailaddressfield.md @@ -1,12 +1,12 @@ # EmailAddress field type -The EmailAddress field type represents an email address, in the form of a string. +The EmailAddress field type represents an email address, in the form of a string. | Name | Internal name | Expected input type | |----------------|---------------|---------------------| -| `EmailAddress` | `ezemail` | `string` | +| `EmailAddress` | `ibexa_email` | `string` | -## PHP API field type  +## PHP API field type ### Value object @@ -14,8 +14,8 @@ The EmailAddress field type represents an email address, in the form of a strin The `Value` class of this field type contains the following properties: -| Property | Type | Description| -|----------|----------|------------| +| Property | Type | Description | +|----------|----------|-----------------------------------------------------------------------| | `$email` | `string` | This property is used for the input string provided as email address. | ``` php @@ -32,14 +32,14 @@ $emailaddressValue->email = "someuser@example.com"; ##### Constructor -The `EmailAddress\Value` constructor initializes a new value object with the value provided. +The `EmailAddress\Value` constructor initializes a new value object with the value provided. It accepts a string as input. ``` php // Constructor example use Ibexa\Core\FieldType\EmailAddress\Type; -  + // Instantiates an EmailAddress Value object $emailaddressValue = new Type\Value( "someuser@example.com" ); ``` @@ -58,8 +58,8 @@ Example: `someuser@example.com` ### Validation -This field type uses the `EmailAddressValidator` validator as a resource which tests the string supplied as input against a pattern, to make sure that a valid email address has been provided. -If the validations fail, a `ValidationError` is thrown, specifying the error message. +This field type uses the `EmailAddressValidator` validator as a resource which tests the string supplied as input against a pattern, to make sure that a valid email address has been provided. +If the validations fail, a `ValidationError` is thrown, specifying the error message. ### Settings diff --git a/docs/content_management/field_types/field_type_reference/field_type_reference.md b/docs/content_management/field_types/field_type_reference/field_type_reference.md index 12ef9539c5..72ffc104ef 100644 --- a/docs/content_management/field_types/field_type_reference/field_type_reference.md +++ b/docs/content_management/field_types/field_type_reference/field_type_reference.md @@ -1,7 +1,7 @@ --- description: Ibexa DXP offers a range of built-in field types that cover most common needs when creating content. page_type: reference -month_change: false +month_change: true --- # Field type reference @@ -18,52 +18,49 @@ In addition, it's possible to extend the system by creating custom types for spe For general field type documentation, see [field type](field_types.md). -Custom field types have to be programmed in PHP. However, the built-in field types are usually sufficient enough for typical scenarios. -The following table gives an overview of the supported field types that come with [[= product_name =]]. - +Custom field types have to be programmed in PHP. +However, the built-in field types are usually enough for typical scenarios. +The following table gives an overview of the supported field types that come with [[= product_name =]]. ## Available field types -| Field type | Description | Searchable in Legacy Storage engine | Searchable with Solr/Elasticsearch | -|------------|-------------|-------------------------------------|----------------------| -| [Address](addressfield.md) | Stores an address. | No | No | -| [Author](authorfield.md) | Stores a list of authors, each consisting of author name and author email. | No | Yes | -| [BinaryFile](binaryfilefield.md) | Stores a file.| Yes | Yes | -| [Checkbox](checkboxfield.md) | Stores a boolean value. | Yes | Yes | -| [Content query](contentqueryfield.md) | Maps an executable repository query to a field. | No | No | -| [Country](countryfield.md) | Stores country names as a string. | Yes[^1^](#1-note-on-legacy-search-engine) | Yes | -| [Customer group](customergroupfield.md) | Stores customer group to which a user belongs. -| [DateAndTime](dateandtimefield.md) | Stores a full date including time information. | Yes | Yes | -| [Date](datefield.md) | Stores date information. | Yes | Yes | -| [EmailAddress](emailaddressfield.md) | Validates and stores an email address. | Yes | Yes | -| [Float](floatfield.md) | Validates and stores a floating-point number. | No | Yes | -| [Form](formfield.md) | Stores a form. | No | Yes | -| [Image](imagefield.md) | Validates and stores an image. | No | Yes | -|[ImageAsset](imageassetfield.md)|Stores images in independent content items of a generic Image content type.| No | Yes | -| [Integer](integerfield.md) | Validates and stores an integer value. | Yes | Yes | -| [ISBN](isbnfield.md) | Handles International Standard Book Number (ISBN) in 10-digit or 13-digit format. | Yes | Yes | -| [Keyword](keywordfield.md) | Stores keywords. | Yes[^1^](#1-note-on-legacy-search-engine) | Yes | -| [MapLocation](maplocationfield.md) | Stores map coordinates. | Yes, with [`MapLocationDistance` Criterion](maplocationdistance_criterion.md) | Yes | -| [Matrix](matrixfield.md) | Represents and handles a table of rows and columns of data. | No | No | -| [Measurement](measurementfield.md) | Validates and stores a unit of measure, and either a single measurement value, or top and bottom values of a measurement range. | Yes | Yes | -| [Media](mediafield.md) | Validates and stores a media file. | No | Yes | -| [Null](nullfield.md) | Used as fallback for missing field types and for testing purposes. | N/A | N/A | -| [Page](pagefield.md) | Stores a Page with a layout consisting of multiple zones. | N/A | N/A | -| [Relation](relationfield.md) | Validates and stores a relation to a content item. | Yes, with both [`Field`](fieldrelation_criterion.md) Criteria | Yes | -| [RelationList](relationlistfield.md) | Validates and stores a list of relations to content items. | Yes, with [`FieldRelation` Criterion](fieldrelation_criterion.md) | Yes | -| [RichText](richtextfield.md) | Validates and stores structured rich text in DocBook xml format, and exposes it in several formats. Available via [IbexaFieldTypeRichTextBundle](https://github.com/ibexa/fieldtype-richtext). | Yes[^1^](#1-note-on-legacy-search-engine) | Yes | -| [Selection](selectionfield.md) | Validates and stores a single selection or multiple choices from a list of options. | Yes[^1^](#1-note-on-legacy-search-engine) | Yes | -| [SesExternaldata](sesexternaldata.md) | Uses external storage to store data. ||| -| [SesProfiledata](sesprofiledata.md) | Stores address data for a customer. | No | No | -| [SesSelection](sesselection.md) | Stores a single selection choice based on options from a YAML file. | Yes | Yes | -| [SpecificationsType](specificationstype.md) | Stores a structured list of specification data for products. | Yes | Yes | -| [TaxonomyEntry](taxonomyentryfield.md) | Stores information about the Taxonomy tree. | No | Yes | -| [TaxonomyEntryAssignment](taxonomyentryassignmentfield.md) | Makes content taggable by Taxonomy. | No | Yes | -| [TextBlock](textblockfield.md) | Validates and stores a larger block of text. | Yes[^1^](#1-note-on-legacy-search-engine) | Yes | -| [TextLine](textlinefield.md) | Validates and stores a single line of text. | Yes | Yes | -| [Time](timefield.md) | Stores time information. | Yes | Yes | -| [Url](urlfield.md) | Stores a URL / address. | No | Yes | -| [User](userfield.md) | Validates and stores information about a user. | No | No | +| Field type | Description | Searchable in Legacy Storage engine | Searchable with Solr/Elasticsearch | +|------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|------------------------------------| +| [Address](addressfield.md) | Stores an address. | No | No | +| [Author](authorfield.md) | Stores a list of authors, each consisting of author name and author email. | No | Yes | +| [BinaryFile](binaryfilefield.md) | Stores a file. | Yes | Yes | +| [Checkbox](checkboxfield.md) | Stores a boolean value. | Yes | Yes | +| [Content query](contentqueryfield.md) | Maps an executable repository query to a field. | No | No | +| [Country](countryfield.md) | Stores country names as a string. | Yes[^1^](#1-note-on-legacy-search-engine) | Yes | +| [Customer group](customergroupfield.md) | Stores customer group to which a user belongs. | Yes, in [Search](customergroupid_criterion.md) and [Price Search](price_customergroup_criterion.md) | Yes | +| [DateAndTime](dateandtimefield.md) | Stores a full date including time information. | Yes | Yes | +| [Date](datefield.md) | Stores date information. | Yes | Yes | +| [EmailAddress](emailaddressfield.md) | Validates and stores an email address. | Yes | Yes | +| [Float](floatfield.md) | Validates and stores a floating-point number. | No | Yes | +| [Form](formfield.md) | Stores a form. | No | Yes | +| [Image](imagefield.md) | Validates and stores an image. | No | Yes | +| [ImageAsset](imageassetfield.md) | Stores images in independent content items of a generic Image content type. | No | Yes | +| [Integer](integerfield.md) | Validates and stores an integer value. | Yes | Yes | +| [ISBN](isbnfield.md) | Handles International Standard Book Number (ISBN) in 10-digit or 13-digit format. | Yes | Yes | +| [Keyword](keywordfield.md) | Stores keywords. | Yes[^1^](#1-note-on-legacy-search-engine) | Yes | +| [MapLocation](maplocationfield.md) | Stores map coordinates. | Yes, with [`MapLocationDistance` Criterion](maplocationdistance_criterion.md) | Yes | +| [Matrix](matrixfield.md) | Represents and handles a table of rows and columns of data. | No | No | +| [Measurement](measurementfield.md) | Validates and stores a unit of measure, and either a single measurement value, or a pair of range values. | Yes | Yes | +| [Media](mediafield.md) | Validates and stores a media file. | No | Yes | +| [Null](nullfield.md) | Used as fallback for missing field types and for testing purposes. | N/A | N/A | +| [Page](pagefield.md) | Stores a Page with a layout consisting of multiple zones. | N/A | N/A | +| [ProductSpecification](productspecificationfield.md) | Stores product attributes and VAT | Yes but only with [Product Search](product_search_criteria.md) | Yes | +| [Relation](relationfield.md) | Validates and stores a relation to a content item. | Yes, with both [`Field`](field_criterion.md) and [`FieldRelation`](fieldrelation_criterion.md) Criteria | Yes | +| [RelationList](relationlistfield.md) | Validates and stores a list of relations to content items. | Yes, with [`FieldRelation` Criterion](fieldrelation_criterion.md) | Yes | +| [RichText](richtextfield.md) | Validates and stores structured rich text in XML. | Yes[^1^](#1-note-on-legacy-search-engine) | Yes | +| [Selection](selectionfield.md) | Validates and stores a single selection or multiple choices from a list of options. | Yes[^1^](#1-note-on-legacy-search-engine) | Yes | +| [TaxonomyEntry](taxonomyentryfield.md) | Stores information about the Taxonomy tree. | No | Yes | +| [TaxonomyEntryAssignment](taxonomyentryassignmentfield.md) | Makes content taggable by Taxonomy. | No | Yes | +| [TextBlock](textblockfield.md) | Validates and stores a larger block of text. | Yes[^1^](#1-note-on-legacy-search-engine) | Yes | +| [TextLine](textlinefield.md) | Validates and stores a single line of text. | Yes | Yes | +| [Time](timefield.md) | Stores time information. | Yes | Yes | +| [Url](urlfield.md) | Stores a URL / address. | No | Yes | +| [User](userfield.md) | Validates and stores information about a user. | No | No | **^[1]^ Note on Legacy Search Engine** diff --git a/docs/content_management/field_types/field_type_reference/floatfield.md b/docs/content_management/field_types/field_type_reference/floatfield.md index e544384a7b..5f23b970f1 100644 --- a/docs/content_management/field_types/field_type_reference/floatfield.md +++ b/docs/content_management/field_types/field_type_reference/floatfield.md @@ -4,18 +4,18 @@ This field type stores numeric values which are provided as floats. | Name | Internal name | Expected input | |---------|---------------|----------------| -| `Float` | `ezfloat` | `float` | +| `Float` | `ibexa_float` | `float` | -## PHP API field type  +## PHP API field type ### Input expectations The field type expects a number as input. Both decimal and integer numbers are accepted. -|Type|Example| -|------|------| -|`float`|`194079.572`| -|`int`|`144`| +| Type | Example | +|---------|--------------| +| `float` | `194079.572` | +| `int` | `144` | ### Value object @@ -23,8 +23,8 @@ The field type expects a number as input. Both decimal and integer numbers are a The Value class of this field type contains the following properties: -| Property | Type | Description| -|----------|---------|------------| +| Property | Type | Description | +|----------|---------|---------------------------------------------------------------| | `$value` | `float` | This property is used to store the value provided as a float. | ``` php @@ -40,7 +40,7 @@ $float->value = 284.773 ##### Constructor -The `Float\Value` constructor initializes a new value object with the value provided. +The `Float\Value` constructor initializes a new value object with the value provided. It expects a numeric value with or without decimals. ``` php @@ -56,10 +56,10 @@ $floatValue = new Type\Value( 284.773 ); This field type supports `FloatValueValidator`, defining maximum and minimum float value: -|Name|Type|Default value|Description| -|------|------|------|------| -|`minFloatValue`|`float`|`null|This setting defines the minimum value this field type which is allowed as input.| -|`maxFloatValue`|`float`|`null|This setting defines the maximum value this field type which is allowed as input.| +| Name | Type | Default value | Description | +|-----------------|---------|---------------|-----------------------------------------------------------------------------------| +| `minFloatValue` | `float` | `null | This setting defines the minimum value this field type which is allowed as input. | +| `maxFloatValue` | `float` | `null | This setting defines the maximum value this field type which is allowed as input. | ``` php // Validator configuration example in PHP diff --git a/docs/content_management/field_types/field_type_reference/formfield.md b/docs/content_management/field_types/field_type_reference/formfield.md index 00a3081439..8b9296472b 100644 --- a/docs/content_management/field_types/field_type_reference/formfield.md +++ b/docs/content_management/field_types/field_type_reference/formfield.md @@ -8,8 +8,6 @@ The Form field type stores a Form consisting of one or more form fields. | Name | Internal name | |--------|---------------| -| `Form` | `ezform` | - - +| `Form` | `ibexa_form` | For more information about working with Forms, see [Forms](work_with_forms.md). diff --git a/docs/content_management/field_types/field_type_reference/imageassetfield.md b/docs/content_management/field_types/field_type_reference/imageassetfield.md index a81e3d7714..65da261fd9 100644 --- a/docs/content_management/field_types/field_type_reference/imageassetfield.md +++ b/docs/content_management/field_types/field_type_reference/imageassetfield.md @@ -1,29 +1,33 @@ # ImageAsset field type -ImageAsset field type enables storing images in independent content items of a generic Image content type, in the media library. +Image Asset field type enables storing images in independent content items of a generic Image content type, in the media library. It makes them reusable across system. +| Name | Internal name | +|--------------|---------------------| +| `ImageAsset` | `ibexa_image_asset` | + ### Input expectations Example array: -|Type|Description|Example| -|------|------|------| -|`Ibexa\Core\FieldType\ImageAsset\Value`|ImageAsset field type value object.|See below.| -|`Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo`|ContentInfo instance of the Asset content item. |n/a| -|`string`| ID of the Asset content item. |`"150"`| -|`integer`| ID of the Asset content item. | `150`| +| Type | Description | Example | +|--------------------------------------------------------------|-------------------------------------------------|------------| +| `Ibexa\Core\FieldType\ImageAsset\Value` | Image Asset field type value object. | See below. | +| `Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo` | ContentInfo instance of the Asset content item. | n/a | +| `string` | ID of the Asset content item. | `"150"` | +| `integer` | ID of the Asset content item. | `150` | ### Value object ##### Properties -Value object of `ezimageasset` contains the following properties: +Value object of `ibexa_image_asset` contains the following properties: -| Property | Type | Description| -|----------|-------|------------| -| `destinationContentId` | `int` | Related content ID. | -| `alternativeText` | `string` | The alternative image text (for example "Picture of an apple."). | +| Property | Type | Description | +|------------------------|----------|------------------------------------------------------------------| +| `destinationContentId` | `int` | Related content ID. | +| `alternativeText` | `string` | The alternative image text (for example "Picture of an apple."). | ``` php // Value object content example @@ -54,12 +58,12 @@ This field type validates if: ImageAsset field type allows configuring the following options: -|Name|Description|Default value| -|----|-----------|-------------| -|`content_type_identifier`|Content type used to store assets.|`image`| -|`content_field_identifier`|Field identifier used for asset data.|`image`| -|`name_field_identifier`|Field identifier used for asset name.|`name`| -|`parent_location_id`|Location where the assets are created.|`51`| +| Name | Description | Default value | +|----------------------------|----------------------------------------|---------------| +| `content_type_identifier` | Content type used to store assets. | `image` | +| `content_field_identifier` | Field identifier used for asset data. | `image` | +| `name_field_identifier` | Field identifier used for asset name. | `name` | +| `parent_location_id` | Location where the assets are created. | `51` | Example configuration: @@ -68,7 +72,7 @@ ibexa: system: default: fieldtypes: - ezimageasset: + ibexa_image_asset: content_type_identifier: photo content_field_identifier: image name_field_identifier: title @@ -77,10 +81,10 @@ ibexa: ## Customizing ImageAsset field type rendering -Internally the Image Asset Type is rendered via subrequest (similar to other relation types). +Internally, the Image Asset Type is rendered via subrequest (similar to other relation types). Rendering customization is possible by configuring view type `asset_image`: -```php +```yaml ibexa: system: default: diff --git a/docs/content_management/field_types/field_type_reference/imagefield.md b/docs/content_management/field_types/field_type_reference/imagefield.md index b28392c6a2..065ef0dda2 100644 --- a/docs/content_management/field_types/field_type_reference/imagefield.md +++ b/docs/content_management/field_types/field_type_reference/imagefield.md @@ -4,36 +4,29 @@ The Image field type allows you to store an image file. | Name | Internal name | |---------|---------------| -| `Image` | `ezimage` | +| `Image` | `ibexa_image` | -A **variation service** handles the conversion of the original image into different formats and sizes through a set of preconfigured named variations, for example, large, small, medium, or black and white thumbnail. +A **variation service** handles the conversion of the original image into different formats and sizes through a set of preconfigured named variations, for example, large, small, medium, or black and white thumbnail. ## PHP API field type ### Value object -The `value` property of an Image field returns an `Ibexa\Core\FieldType\Image\Value` object with the following properties: +The `value` property of an Image field returns an `Ibexa\Core\FieldType\Image\Value` object with the following properties: ##### Properties -|Property|Type|Example|Description| -|------|------|------|------| -|`id`|string|`0/8/4/1/1480-1-eng-GB/image.png`|The image's unique identifier. Usually the path, or a part of the path. To get the full path, use the `uri` property.| -|`alternativeText`|string|`Picture of an apple.`|The alternative text, as entered in the field's properties. This property is optional. It's recommended that you require the alternative text for an image when you add the Image field to a content type, by selecting the "Alternative text is required" checkbox.| -|`fileName`|string|`image.png`|The original image's filename, without the path.| -|`fileSize`|int|`37931`|The original image's size, in bytes.| -|`uri`|string|`var/ezdemo_site/storage/images/0/8/4/1/1480-1-eng-GB/image.png`|The original image's URI.| -|`imageId`|string|`240-1480`|A special image ID, used by REST.| -|`inputUri`|string|`var/storage/images/test/199-2-eng-GB/image.png`|Input image file URI.| -|`width`*|int|`null`|Original image width in pixels. For more details see Caution note below.| -|`height`*|int|`null`|Original image height in pixels. For more details see Caution note below.| - -!!! caution - - Properties marked with an asterisk are currently unsupported. - They're available but their value is always `null`. - - Follow [EZP-27987](https://issues.ibexa.co/browse/EZP-27987) for future progress on this issue. +| Property | Type | Example | Description | +|-------------------|--------|------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `id` | string | `0/8/4/1/1480-1-eng-GB/image.png` | The image's unique identifier. Usually the path, or a part of the path. To get the full path, use the `uri` property. | +| `alternativeText` | string | `Picture of an apple.` | The alternative text, as entered in the field's properties. This property is optional. It's recommended that you require the alternative text for an image when you add the Image field to a content type, by selecting the "Alternative text is required" checkbox. | +| `fileName` | string | `image.png` | The original image's filename, without the path. | +| `fileSize` | int | `37931` | The original image's size, in bytes. | +| `uri` | string | `var/ezdemo_site/storage/images/0/8/4/1/1480-1-eng-GB/image.png` | The original image's URI. | +| `imageId` | string | `240-1480` | A special image ID, used by REST. | +| `inputUri` | string | `var/storage/images/test/199-2-eng-GB/image.png` | Input image file URI. | +| `width` | int | `960` | Original image width in pixels. | +| `height` | int | `540` | Original image height in pixels. | ### Settings @@ -42,27 +35,20 @@ This field type doesn't support settings. ### Image variations Using the variation Service, variations of the original image can be obtained. -They're `Ibexa\Contracts\Core\Variation\Values\ImageVariation` objects with the following properties: - -| Property | Type | Example | Description| -|----------------|----------|----------|------------| -| `width`* | int | `null` | The variation's width in pixels. For more details see Caution note below.| -| `height`* | int | `null` | The variation's height in pixels. For more details see Caution note below.| -| `name` | string | `medium` | The variation's identifier, name of the image variation.| -| `info` | mixed |n/a| Extra information about the image, depending on the image type, such as EXIF data. If there is no information, the `info` value is `null`.| -| `fileSize` | int |`31010` |Size (in byte) of current variation.| -| `mimeType` | string |`image/png`|The MIME type.| -| `fileName` | string |`my_image.png`|The name of the file.| -| `dirPath` | string |`var/storage/images/test/199-2-eng-GB`|The path to the file.| -| `uri` | string |`var/storage/images/test/199-2-eng-GB/apple.png`| The variation's URI. Complete path with a name of image file.| -| `lastModified` | DateTime |``"2017-08-282 12:20 Europe/Berlin"``| When the variation was last modified.| - -!!! caution - - Properties marked with an asterisk are currently unsupported. - They're available but their value is always `null`. - - Follow [EZP-27987](https://issues.ibexa.co/browse/EZP-27987) for future progress on this issue. +They're `Ibexa\Contracts\Core\Variation\Values\ImageVariation` objects with the following properties: + +| Property | Type | Example | Description | +|----------------|----------|--------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------| +| `width` | int | `200` | The variation's width in pixels. For more details see Caution note below. | +| `height` | int | `112` | The variation's height in pixels. For more details see Caution note below. | +| `name` | string | `medium` | The variation's identifier, name of the image variation. | +| `info` | mixed | n/a | Extra information about the image, depending on the image type, such as EXIF data. If there is no information, the `info` value is `null`. | +| `fileSize` | int | `31010` | Size (in byte) of current variation. | +| `mimeType` | string | `image/png` | The MIME type. | +| `fileName` | string | `my_image.png` | The name of the file. | +| `dirPath` | string | `var/storage/images/test/199-2-eng-GB` | The path to the file. | +| `uri` | string | `var/storage/images/test/199-2-eng-GB/apple.png` | The variation's URI. Complete path with a name of image file. | +| `lastModified` | DateTime | ``"2017-08-282 12:20 Europe/Berlin"`` | When the variation was last modified. | ### Field Definition options @@ -70,11 +56,9 @@ The Image field type supports one `FieldDefinition` option: the maximum size for !!! note - Maximum size is rounded to 1 MB (legacy storage limitation). - -!!! note - - As the default value for maximum size is set to 10MB, we recommend setting the `upload_max_filesize` key in the `php.ini` configuration file to a value equal to or higher than that. It prevents validation errors while editing content types. + Maximum size is 10MB. + We recommend setting the `upload_max_filesize` key in the `php.ini` configuration file to a value equal to or higher than that. + It prevents validation errors while editing content types. ## Using an Image field @@ -82,28 +66,28 @@ To read more about handling images and image variations, see the [Images documen ### Template Rendering -When displayed using `ibexa_render_field`, an Image field outputs this type of HTML: +When displayed using `ibexa_render_field`, an Image field outputs this type of HTML: ``` html+twig Alternative text ``` -The template called by the [`ibexa_render_field()` Twig function](field_twig_functions.md#ibexa_render_field) while rendering a Image field accepts the following parameters: +The template called by the [`ibexa_render_field()` Twig function](field_twig_functions.md#ibexa_render_field) while rendering a Image field accepts the following parameters: -| Parameter | Type | Default | Description | -|-----------|----------|----------------|-------------| -| `alias` | `string` | `"original"` | The image variation name, must be defined in your SiteAccess's `image_variations` settings. Defaults to "original", the originally uploaded image.| -| `width` | `int` |   n/a | Optionally to specify a different width set on the image HTML tag then then one from image alias. | -| `height` | `int` |   n/a | Optionally to specify a different height set on the image HTML tag then then one from image alias. | -| `class` | `string` |   n/a | Optionally to specify a specific html class for use in custom JavaScript and/or CSS. | +| Parameter | Type | Default | Description | +|-----------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------| +| `alias` | `string` | `"original"` | The image variation name, must be defined in your SiteAccess's `image_variations` settings. Defaults to "original", the originally uploaded image. | +| `width` | `int` | n/a | Optionally to specify a different width set on the image HTML tag then one from image variation. | +| `height` | `int` | n/a | Optionally to specify a different height set on the image HTML tag then one from image variation. | +| `class` | `string` | n/a | Optionally to specify a specific html class for use in custom JavaScript and/or CSS. | -Example:  +Example: ``` html+twig {{ ibexa_render_field( content, 'image', { 'parameters':{ 'alias': 'imagelarge', 'width': 400, 'height': 400 } } ) }} ``` -The raw field can also be used if needed. Image variations for the field's content can be obtained using the `ibexa_image_alias` Twig helper: +The raw field can also be used if needed. Image variations for the field's content can be obtained using the `ibexa_image_alias` Twig helper: ``` html+twig {% set imageAlias = ibexa_image_alias( field, versionInfo, 'medium' ) %} @@ -117,7 +101,7 @@ The variation's properties can be used to generate the required output: ### With the REST API -Image Fields within REST are exposed by the `application/vnd.ibexa.api.Content` media-type. +Image Fields within REST are exposed by the `application/vnd.ibexa.api.Content` media-type. An Image field looks like this: ``` xml @@ -178,7 +162,7 @@ echo $variation->uri; ### From PHP As for any field type, there are several ways to input content to a field. -For an Image, the quickest is to call `setField()` on the ContentStruct: +For an Image, the quickest is to call `setField()` on the ContentStruct: ``` php $createStruct = $contentService->newContentCreateStruct( @@ -221,7 +205,7 @@ $createStruct->setField( 'image', $imageValue ); ### From REST The REST API expects field values to be provided in a hash-like structure. -Those keys are identical to those expected by the `Image\Value` constructor: `fileName`, `alternativeText`. +Those keys are identical to those expected by the `Image\Value` constructor: `fileName`, `alternativeText`. In addition, image data can be provided using the `data` property, with the image's content encoded as base64. #### Creating an Image field @@ -250,8 +234,8 @@ In addition, image data can be provided using the `data` property, with the imag ### Updating an Image field Updating an Image field requires that you re-send existing data. -This can be done by re-using the field obtained via REST, **removing the variations key**, and updating `alternativeText`, `fileName` or `data`. -If you don't want to change the image itself, don't provide the `data` key. +This can be done by re-using the field obtained via REST, **removing the variations key**, and updating `alternativeText`, `fileName` or `data`. +If you don't want to change the image itself, don't provide the `data` key. ``` xml @@ -284,13 +268,13 @@ Images are stored within the following directory structure: With the following values: - `VarDir` = `var` (default) -- `StorageDir` = `storage` (default) +- `StorageDir` = `storage` (default) - `ImagesStorageDir` = `images` (default) - `FieldId` = `1480` - `VersionNumber` = `1` - `LanguageCode` = `eng-GB` -Images are stored in `web/var/ezdemo_site/storage/images/0/8/4/1/1480-1-eng-GB`. +Images are stored in `web/var/ezdemo_site/storage/images/0/8/4/1/1480-1-eng-GB`. Using the field ID digits in reverse order as the folder structure maximizes sharding of files through multiple folders on the filesystem. diff --git a/docs/content_management/field_types/field_type_reference/integerfield.md b/docs/content_management/field_types/field_type_reference/integerfield.md index 11f1357ecd..c1eb8f3b9d 100644 --- a/docs/content_management/field_types/field_type_reference/integerfield.md +++ b/docs/content_management/field_types/field_type_reference/integerfield.md @@ -2,17 +2,17 @@ This field type represents an integer value. -| Name | Internal name | Expected input | -|-----------|---------------|----------------| -| `Integer` | `ezinteger` | `integer` | +| Name | Internal name | Expected input | +|-----------|-----------------|----------------| +| `Integer` | `ibexa_integer` | `integer` | -## PHP API field type  +## PHP API field type ### Input expectations -|Type|Example| -|-------|------| -|`integer`|`2397`| +| Type | Example | +|-----------|---------| +| `integer` | `2397` | ### Value object @@ -31,13 +31,13 @@ $integer->value = 8 ##### Constructor -The `Integer\Value` constructor initializes a new value object with the value provided. +The `Integer\Value` constructor initializes a new value object with the value provided. It expects a numeric, integer value. ``` php // Constructor example use Ibexa\Core\FieldType\Integer; -  + // Instantiates a Integer Value object $integerValue = new Integer\Value( 8 ); ``` @@ -56,7 +56,7 @@ Example: `"8"` ### Validation -This field type supports `IntegerValueValidator`, defining maximum and minimum float value: +This field type supports `IntegerValueValidator`, defining maximum and minimum float value: |Name|Type|Default value|Description| |------|------|------|------| diff --git a/docs/content_management/field_types/field_type_reference/isbnfield.md b/docs/content_management/field_types/field_type_reference/isbnfield.md index 98e9a23ad7..8b4baf9c51 100644 --- a/docs/content_management/field_types/field_type_reference/isbnfield.md +++ b/docs/content_management/field_types/field_type_reference/isbnfield.md @@ -4,9 +4,9 @@ This field type represents an ISBN string either an ISBN-10 or ISBN-13 format. | Name | Internal name | Expected input type | |--------|---------------|---------------------| -| `ISBN` | `ezisbn` | `string` | +| `ISBN` | `ibexa_isbn` | `string` | -## PHP API field type  +## PHP API field type ### Value object @@ -14,8 +14,8 @@ This field type represents an ISBN string either an ISBN-10 or ISBN-13 format. The Value class of this field type contains the following properties: -| Property | Type | Description| -|----------|----------|------------| +| Property | Type | Description | +|----------|----------|--------------------------------------------| | `$isbn` | `string` | This property is used for the ISBN string. | ##### String representation @@ -25,7 +25,7 @@ An ISBN's string representation is the `$isbn` property's value, as a string. ##### Constructor The constructor for this value object initializes a new value object with the value provided. -It accepts a string as argument and sets it to the `isbn` attribute. +It accepts a string as argument and sets it to the `isbn` attribute. ### Validation diff --git a/docs/content_management/field_types/field_type_reference/keywordfield.md b/docs/content_management/field_types/field_type_reference/keywordfield.md index 5e2d67bd69..1d1d09b35f 100644 --- a/docs/content_management/field_types/field_type_reference/keywordfield.md +++ b/docs/content_management/field_types/field_type_reference/keywordfield.md @@ -2,19 +2,19 @@ This field type stores one or several comma-separated keywords as a string or array of strings. -| Name | Internal name | Expected input| -|-----------|---------------|---------------| -| `Keyword` | `ezkeyword` | `string[]|string` | +| Name | Internal name | Expected input | +|-----------|-----------------|-------------------| +| `Keyword` | `ibexa_keyword` | `string[]|string` | -## PHP API field type  +## PHP API field type ### Input expectations -|Type|Example| -|------|------| -|`string`|`"documentation"`| -|`string`|`"php, Ibexa Platform, html5"`| -|`string[]`|`[ "Ibexa", "Enterprise", "User Experience Management" ]`| +| Type | Example | +|------------|-----------------------------------------------------------| +| `string` | `"documentation"` | +| `string` | `"php, Ibexa Platform, html5"` | +| `string[]` | `[ "Ibexa", "Enterprise", "User Experience Management" ]` | ### Value object @@ -22,34 +22,34 @@ This field type stores one or several comma-separated keywords as a string or ar The Value class of this field type contains the following properties: -| Property | Type | Description| -|----------|------------|------------| -| `$value` | `string[]` | Holds an array of keywords as strings.| +| Property | Type | Description | +|----------|------------|----------------------------------------| +| `$value` | `string[]` | Holds an array of keywords as strings. | ``` php // Value object content example use Ibexa\Core\FieldType\Keyword\Value; -  + // Instantiates a Value object $keywordValue = new Value(); -  + // Sets an array of keywords as a value $keyword->value = [ "php", "css3", "html5", "Ibexa Platform" ]; ``` #### Constructor -The `Keyword\Value` constructor initializes a new value object with the value provided. +The `Keyword\Value` constructor initializes a new value object with the value provided. It expects a list of keywords, either comma-separated in a string or as an array of strings. ``` php // Constructor example use Ibexa\Core\FieldType\Keyword\Value; -  + // Instantiates a Value object with an array of keywords $keywordValue = new Value( [ "php5", "css3", "html5" ] ); -  + // Instantiates a Value object with a list of keywords in a string // This is equivalent to the example above $keywordValue = new Value( "php5,css3,html5" ); diff --git a/docs/content_management/field_types/field_type_reference/maplocationfield.md b/docs/content_management/field_types/field_type_reference/maplocationfield.md index b7cf7b8c18..feaf4ef115 100644 --- a/docs/content_management/field_types/field_type_reference/maplocationfield.md +++ b/docs/content_management/field_types/field_type_reference/maplocationfield.md @@ -7,17 +7,17 @@ As input it expects three values: - two float values latitude and longitude, - a string value, corresponding to the name or address of the location. -| Name | Internal name | Expected input | -|---------------|------------------|----------------| -| `MapLocation` | `ezgmaplocation` | `mixed` | +| Name | Internal name | Expected input | +|---------------|-----------------------|----------------| +| `MapLocation` | `ibexa_gmap_location` | `mixed` | -## PHP API field type  +## PHP API field type ### Input expectations -|Type|Example| -|------|------| -|`array`|`[ 'latitude' => 59.928732, 'longitude' => 10.777888, 'address' => "Ibexa Nordics" ]`| +| Type | Example | +|---------|---------------------------------------------------------------------------------------| +| `array` | `[ 'latitude' => 59.928732, 'longitude' => 10.777888, 'address' => "Ibexa Nordics" ]` | ### Value object @@ -25,15 +25,15 @@ As input it expects three values: The Value class of this field type contains the following properties: -|Property|Type|Description| -|------|------|------| -|`$latitude`|`float`|This property stores the latitude value of the map location reference.| -|`$longitude`|`float`|This property stores the longitude value of the map location reference.| -|`$address`|`string`|This property stores the address of map location.| +| Property | Type | Description | +|--------------|----------|-------------------------------------------------------------------------| +| `$latitude` | `float` | This property stores the latitude value of the map location reference. | +| `$longitude` | `float` | This property stores the longitude value of the map location reference. | +| `$address` | `string` | This property stores the address of map location. | ##### Constructor -The `MapLocation\Value` constructor initializes a new value object with values provided as hash. +The `MapLocation\Value` constructor initializes a new value object with values provided as hash. Accepted keys are `latitude` (`float`), `longitude` (`float`), `address` (`string`). ``` php @@ -41,27 +41,27 @@ Accepted keys are `latitude` (`float`), `longitude` (`float`), `address` (`strin // Instantiates a MapLocation Value object $MapLocationValue = new MapLocation\Value( - [ - 'latitude' => 59.928732, - 'longitude' => 10.777888, - 'address' => "Ibexa Nordics" - ] - ); + [ + 'latitude' => 59.928732, + 'longitude' => 10.777888, + 'address' => "Ibexa Nordics" + ] +); ``` ## Template rendering The template called by [the `ibexa_render_field()` Twig function](field_twig_functions.md#ibexa_render_field) while rendering a Map location field accepts the following parameters: -|Parameter|Type|Default|Description| -|------|------|------|------| -|`draggable`|`boolean`|`true`|Whether to enable a draggable map.| -|`height`|`string|false`|`"200px"`|The height of the rendered map with its unit (for example "200px" or "20em"), set to false to not set any height style inline.| -|`scrollWheel`|`boolean`|`true`| Allows you to disable scroll wheel starting to zoom when mouse comes over the map as user scrolls down a page.| -|`showInfo`|`booolean`|`true`|Whether to show a latitude, longitude and the address outside of the map.| -|`showMap`|`boolean`|`true`|Whether to show the OpenStreetMap.| -|`width`|`string|false`|`"500px"`|The width of the rendered map with its unit (for example "500px" or "50em"), set to false to not set any width style inline.| -|`zoom`|`integer`|`13`|The initial zoom level on the map.| +| Parameter | Type | Default | Description | +|---------------|------------|---------|----------------------------------------------------------------------------------------------------------------| +| `draggable` | `boolean` | `true` | Whether to enable a draggable map. | +| `height` | `string | false` | `"200px"` |The height of the rendered map with its unit (for example "200px" or "20em"), set to false to not set any height style inline.| +| `scrollWheel` | `boolean` | `true` | Allows you to disable scroll wheel starting to zoom when mouse comes over the map as user scrolls down a page. | +| `showInfo` | `booolean` | `true` | Whether to show a latitude, longitude and the address outside of the map. | +| `showMap` | `boolean` | `true` | Whether to show the OpenStreetMap. | +| `width` | `string | false` | `"500px"` |The width of the rendered map with its unit (for example "500px" or "50em"), set to false to not set any width style inline.| +| `zoom` | `integer` | `13` | The initial zoom level on the map. | Example: diff --git a/docs/content_management/field_types/field_type_reference/matrixfield.md b/docs/content_management/field_types/field_type_reference/matrixfield.md index a4c32f6401..8c3aa56803 100644 --- a/docs/content_management/field_types/field_type_reference/matrixfield.md +++ b/docs/content_management/field_types/field_type_reference/matrixfield.md @@ -2,9 +2,9 @@ This field represents and handles a table of rows and columns of data. -| Name | Internal name | Expected input | -|----------|---------------|----------------| -| `Matrix` | `ezmatrix` | `array` | +| Name | Internal name | Expected input | +|----------|----------------|----------------| +| `Matrix` | `ibexa_matrix` | `array` | The Matrix field type is available via the Matrix Bundle provided by the [ibexa/fieldtype-matrix](https://github.com/ibexa/fieldtype-matrix) package. @@ -12,9 +12,9 @@ The Matrix field type is available via the Matrix Bundle provided by the [ibexa/ ### Input expectations -|Type|Description|Example| -|------|------|------| -|`array`|array of `Ibexa\FieldTypeMatrix\FieldType\Value\Row` objects which contain column data|see below| +| Type | Description | Example | +|---------|----------------------------------------------------------------------------------------|-----------| +| `array` | array of `Ibexa\FieldTypeMatrix\FieldType\Value\Row` objects which contain column data | see below | Example of input: @@ -28,7 +28,7 @@ new FieldType\Value([ ### Value object -`Ibexa\FieldTypeMatrix\FieldType\Value` offers the following properties: +`Ibexa\FieldTypeMatrix\FieldType\Value` offers the following properties: |Property|Type|Description| |------|------|------| @@ -67,7 +67,7 @@ The example below shows a GraphQL query for a Recipe content item (belonging to - `name`: `ezstring` - `ingredients`: `ezmatrix` with two columns: `ingredient` and `quantity` -``` +```graphql { content { recipe(id: 123) { @@ -83,7 +83,7 @@ The example below shows a GraphQL query for a Recipe content item (belonging to The Type returned for the Matrix field exposes columns defined in the field definition: -``` +```json { "data": { "content": { @@ -110,7 +110,7 @@ The Type returned for the Matrix field exposes columns defined in the field defi With this query you can inspect details of specific content type. In case of a Matrix field, you can ask for the list of columns, their names, and identifiers. -``` +```graphql { content { _types { @@ -139,7 +139,7 @@ The response lists the exposed field type settings: Example response: -``` +```json { "data": { "content": { @@ -179,7 +179,7 @@ The example below shows how to create a Recipe content item (belonging to a cont - `name`: `"Cake Ingredient List"` - `ingredients`: `ezmatrix` with two columns: `ingredient` and `quantity` -``` +```graphql mutation AddRecipe { createRecipe( language: eng_GB @@ -199,7 +199,7 @@ The example below shows how to create a Recipe content item (belonging to a cont The response confirms creation of the new Recipe field: -``` +```json { "data": { "createRecipe": { @@ -207,5 +207,4 @@ The response confirms creation of the new Recipe field: } } } - ``` diff --git a/docs/content_management/field_types/field_type_reference/measurementfield.md b/docs/content_management/field_types/field_type_reference/measurementfield.md index 6b34a5a50c..5db02da753 100644 --- a/docs/content_management/field_types/field_type_reference/measurementfield.md +++ b/docs/content_management/field_types/field_type_reference/measurementfield.md @@ -1,7 +1,7 @@ # Measurement field type The Measurement field type represents measurement information. -It stores the unit of measure, and either a single measurement value, or a pair of values that defines a range. +It stores the unit of measure, and either a single measurement value, or a pair of top and bottom values that defines a range. | Name | Internal name | Expected input type | |---------------|---------------------|----------------------------------------------------| @@ -20,10 +20,10 @@ The service contains the following API endpoints: Assuming that the service exists as `$measurementService`, the expected input examples are as follows: -| Type | Example | -|---------------------------------------------------------|---------------------------------------------------------------------| -|`\Ibexa\Contracts\Measurement\Value\SimpleValueInterface`| `$measurementService->buildSimpleValue('length', 2.5, 'centimeter')`| -|`\Ibexa\Contracts\Measurement\Value\RangeValueInterface` | `$measurementService->buildRangeValue('length', 1.2, 4.5, 'inch')` | +| Type | Example | +|---------------------------------------------------------|----------------------------------------------------------------------| +|`\Ibexa\Contracts\Measurement\Value\SimpleValueInterface`| `$measurementService->buildSimpleValue('length', 2.5, 'centimeter')` | +|`\Ibexa\Contracts\Measurement\Value\RangeValueInterface` | `$measurementService->buildRangeValue('length', 1.2, 4.5, 'inch')` | ### Value object @@ -31,9 +31,9 @@ Assuming that the service exists as `$measurementService`, the expected input ex The Value class of this field type contains the following properties: -| Property | Type | Description | -|----------|--------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `$value` |`Ibexa\Contracts\Measurement\Value\ValueInterface`| Stores the Measurement API Value, which can be either an instance of `Ibexa\Contracts\Measurement\Value\SimpleValueInterface` or `Ibexa\Contracts\Measurement\Value\RangeValueInterface`. | +| Property | Type | Description | +|----------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `$value` | `Ibexa\Contracts\Measurement\Value\ValueInterface` | Stores the Measurement API Value, which can be either an instance of `Ibexa\Contracts\Measurement\Value\SimpleValueInterface` or `Ibexa\Contracts\Measurement\Value\RangeValueInterface`. | ##### Constructor diff --git a/docs/content_management/field_types/field_type_reference/mediafield.md b/docs/content_management/field_types/field_type_reference/mediafield.md index 26e220ccbd..ff9bbeca15 100644 --- a/docs/content_management/field_types/field_type_reference/mediafield.md +++ b/docs/content_management/field_types/field_type_reference/mediafield.md @@ -2,7 +2,7 @@ This field type represents and handles a media (audio/video) binary file. -It's capable of handling the following types of files: +It's capable of handling the following types of files: - Apple QuickTime - Adobe Flash @@ -14,45 +14,45 @@ It's capable of handling the following types of files: | Name | Internal name | Expected input | |---------|---------------|----------------| -| `Media` | `ezmedia` | mixed | +| `Media` | `ibexa_media` | mixed | -## PHP API field type  +## PHP API field type ### Input expectations -| Type | Description | Example| -|------|-------------|--------| -| `string` | Path to the media file.| `/Users/jane/butterflies.mp4` | -| `Ibexa\Core\FieldType\Media\Value` | Media field type value object with path to the media file as the value of `id` property. | See below. | +| Type | Description | Example | +|------------------------------------|------------------------------------------------------------------------------------------|-------------------------------| +| `string` | Path to the media file. | `/Users/jane/butterflies.mp4` | +| `Ibexa\Core\FieldType\Media\Value` | Media field type value object with path to the media file as the value of `id` property. | See below. | ### Value object ##### Properties -`Ibexa\Core\FieldType\Media\Value` offers the following properties. +`Ibexa\Core\FieldType\Media\Value` offers the following properties. Both `Media` and `BinaryFile` Value and Type inherit from the `BinaryBase` abstract field type and share common properties. -|Property|Type|Description|Example| -|------|------|------|------| -|`id`|string|Media file identifier. This ID depends on the [IO Handler](clustering.md#dfs-io-handler) that is being used. With the native, default handlers (FileSystem and Legacy), the ID is the file path, relative to the binary file storage root dir (`var//storage/original` by default).|application/63cd472dd7819da7b75e8e2fee507c68.mp4| -|`fileName`|string| The human-readable file name, as exposed to the outside. Used to name the file when sending it for download.|butterflies.mp4| -|`fileSize`|int|File size, in bytes.|1077923| -|`mimeType`|string|The file's MIME type.|video/mp4| -|`uri`|string|The binary file's HTTP URI. If the URI doesn't include a host or protocol, it applies to the request domain. **The URI is not publicly readable, and must NOT be used to link to the file for download.** Use `ibexa_render_field` to generate a valid link to the download controller.|/var/ezdemo_site/storage/original/application/63cd472dd7819da7b75e8e2fee507c68.mp4| -|`hasController`|boolean|Whether the media has a controller when being displayed.|true| -|`autoplay`|boolean|Whether the media should be automatically played.|true| -|`loop`|boolean|Whether the media should be played in a loop.|false| -|`height`|int|Height of the media.|300| -|`width`|int|Width of the media.|400| -|`path`|string|**deprecated**|| +| Property | Type | Description | Example | +|-----------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------| +| `id` | string | Media file identifier. This ID depends on the [IO Handler](clustering.md#dfs-io-handler) that is being used. With the native, default handlers (FileSystem and Legacy), the ID is the file path, relative to the binary file storage root dir (`var//storage/original` by default). | application/63cd472dd7819da7b75e8e2fee507c68.mp4 | +| `fileName` | string | The human-readable file name, as exposed to the outside. Used to name the file when sending it for download. | butterflies.mp4 | +| `fileSize` | int | File size, in bytes. | 1077923 | +| `mimeType` | string | The file's MIME type. | video/mp4 | +| `uri` | string | The binary file's HTTP URI. If the URI doesn't include a host or protocol, it applies to the request domain. **The URI is not publicly readable, and must NOT be used to link to the file for download.** Use `ibexa_render_field` to generate a valid link to the download controller. | /var/ezdemo_site/storage/original/application/63cd472dd7819da7b75e8e2fee507c68.mp4 | +| `hasController` | boolean | Whether the media has a controller when being displayed. | true | +| `autoplay` | boolean | Whether the media should be automatically played. | true | +| `loop` | boolean | Whether the media should be played in a loop. | false | +| `height` | int | Height of the media. | 300 | +| `width` | int | Width of the media. | 400 | +| `path` | string | **deprecated** | | ### Hash format The hash format mostly matches the value object. It has the following keys: - `id` -- `path` (for backwards compatibility) +- `path` (for backwards compatibility) - `fileName` - `fileSize` - `mimeType` @@ -65,7 +65,7 @@ The hash format mostly matches the value object. It has the following keys: ### Validation -The field type supports `FileSizeValidator`, defining maximum size of media file in bytes: +The field type supports `FileSizeValidator`, defining maximum size of media file in bytes: |Name|Type|Default value|Description| |------|------|------|------| @@ -91,27 +91,27 @@ $mediaFieldCreateStruct->validatorConfiguration = [ The field type supports the `mediaType` setting, defining how the media file should be handled in output. -|Name|Type|Default value|Description| -|------|------|------|------| -|`mediaType`|mixed|`Type::TYPE_HTML5_VIDEO`|Type of the media, accepts one of the predefined constants.| +| Name | Type | Default value | Description | +|-------------|-------|--------------------------|-------------------------------------------------------------| +| `mediaType` | mixed | `Type::TYPE_HTML5_VIDEO` | Type of the media, accepts one of the predefined constants. | -List of all available `mediaType` constants is defined in the `Ibexa\Core\FieldType\Media\Type` class: +List of all available `mediaType` constants is defined in the `Ibexa\Core\FieldType\Media\Type` class: -|Name|Description| -|------|------| -|`TYPE_FLASH`|Adobe Flash| -|`TYPE_QUICKTIME`|Apple QuickTime| -|`TYPE_REALPLAYER`|Real Media| -|`TYPE_SILVERLIGHT`|Silverlight| -|`TYPE_WINDOWSMEDIA`|Microsoft Windows Media| -|`TYPE_HTML5_VIDEO`|HTML5 Video| -|`TYPE_HTML5_AUDIO`|HTML5 Audio| +| Name | Description | +|---------------------|-------------------------| +| `TYPE_FLASH` | Adobe Flash | +| `TYPE_QUICKTIME` | Apple QuickTime | +| `TYPE_REALPLAYER` | Real Media | +| `TYPE_SILVERLIGHT` | Silverlight | +| `TYPE_WINDOWSMEDIA` | Microsoft Windows Media | +| `TYPE_HTML5_VIDEO` | HTML5 Video | +| `TYPE_HTML5_AUDIO` | HTML5 Audio | ``` php // Example of using Media field type settings in PHP use Ibexa\Core\FieldType\Media\Type; -  + $contentTypeService = $repository->getContentTypeService(); $mediaFieldCreateStruct = $contentTypeService->newFieldDefinitionCreateStruct( "media", "ezmedia" ); diff --git a/docs/content_management/field_types/field_type_reference/nullfield.md b/docs/content_management/field_types/field_type_reference/nullfield.md index eb00b59224..d00fe4bbfd 100644 --- a/docs/content_management/field_types/field_type_reference/nullfield.md +++ b/docs/content_management/field_types/field_type_reference/nullfield.md @@ -4,11 +4,11 @@ This field type is used as fallback for migration scenarios, and for testing pur | Name | Internal name | Expected input type | |--------|---------------|---------------------| -| `Null` | variable | mixed | +| `Null` | (variable) | mixed | ## Description -The Null field type serves as an aid when migrating from eZ Publish Platform and earlier legacy versions. +The Null field type aids when migrating from eZ Publish Platform and earlier legacy versions. It's a dummy for legacy field types that aren't implemented in [[= product_name =]]. Null field type accepts anything provided as a value and is usually combined with: diff --git a/docs/content_management/field_types/field_type_reference/pagefield.md b/docs/content_management/field_types/field_type_reference/pagefield.md index fa67799a68..663a709bce 100644 --- a/docs/content_management/field_types/field_type_reference/pagefield.md +++ b/docs/content_management/field_types/field_type_reference/pagefield.md @@ -9,9 +9,9 @@ Each zone can in turn contain blocks. Page field type is only used in the page content type that is included in [[= product_name_exp =]]. -| Name | Internal name | Expected input | -|----------------|-----------------|-----------------| -| `Landing page` | `ezlandingpage` | `string (JSON)` | +| Name | Internal name | Expected input | +|---------------|----------------------|-----------------| +| `LandingPage` | `ibexa_landing_page` | `string` (JSON) | !!! caution "Page Builder" @@ -45,12 +45,12 @@ To render a block inside the layout, use the Twig `render_esi()` function to cal The `renderAction` has the following parameters: -|Parameter|Description| -|---------|-----------| -|`locationId`|ID of the location of the content item which can be accessed by `contentInfo.id`| -|`blockId`|ID of the block which you want to render.| -|`versionNo`|Version number of the content item to render.| -|`languageCode`|Language code of the content item to render.| +| Parameter | Description | +|----------------|----------------------------------------------------------------------------------| +| `locationId` | ID of the location of the content item which can be accessed by `contentInfo.id` | +| `blockId` | ID of the block which you want to render. | +| `versionNo` | Version number of the content item to render. | +| `languageCode` | Language code of the content item to render. | Example usage: diff --git a/docs/content_management/field_types/field_type_reference/productspecificationfield.md b/docs/content_management/field_types/field_type_reference/productspecificationfield.md new file mode 100644 index 0000000000..124986d8fb --- /dev/null +++ b/docs/content_management/field_types/field_type_reference/productspecificationfield.md @@ -0,0 +1,19 @@ +--- +edition: headless +month_change: true +--- + +# Product specification field type + +This field represents and handles [product attributes](products.md#product-attributes) and [VAT](prices.md#vat). +Consider it as internal to the [PIM](pim.md). + +| Name | Internal name | Expected input | +|------------------------|-------------------------------|----------------| +| `ProductSpecification` | `ibexa_product_specification` | mixed | + +!!! caution + + The presence of a specification (`ibexa_product_specification`) field distincts product types from content types. + Don't remove this field from a product type (or it becomes a unreachable hidden content type). + Don't add such field to a content type (or it becomes an uneditable unusable product type). diff --git a/docs/content_management/field_types/field_type_reference/relationfield.md b/docs/content_management/field_types/field_type_reference/relationfield.md index be684274cb..6f8b9a8543 100644 --- a/docs/content_management/field_types/field_type_reference/relationfield.md +++ b/docs/content_management/field_types/field_type_reference/relationfield.md @@ -2,18 +2,18 @@ This field type makes it possible to store and retrieve the value of a relation to another content item. -| Name | Internal name | Expected input | -|------------|--------------------|----------------| -| `Relation` | `ezobjectrelation` | mixed | +| Name | Internal name | Expected input | +|------------|-------------------------|----------------| +| `Relation` | `ibexa_object_relation` | mixed | ## PHP API field type ### Input expectations -|Type|Example| -|------|------| -|`string`|`"150"`| -|`integer`|`150`| +| Type | Example | +|-----------|---------| +| `string` | `"150"` | +| `integer` | `150` | ### Value object @@ -21,8 +21,8 @@ This field type makes it possible to store and retrieve the value of a relation The Value class of this field type contains the following properties: -| Property|Type| Description| -|---------|-----|-----------| +| Property | Type | Description | +|------------------------|-------------------|-------------------------------------------------------------------------------------------| | `$destinationContentId` | `string|int|null` | This property is used to store the value provided, which represents the related content. | ``` php @@ -33,7 +33,7 @@ $relation->destinationContentId = $contentInfo->id; ##### Constructor -The `Relation\Value` constructor initializes a new value object with the value provided. It expects a mixed value. +The `Relation\Value` constructor initializes a new value object with the value provided. It expects a mixed value. ``` php // Constructor example @@ -50,11 +50,11 @@ This field type validates whether the provided relation exists, but before that The field definition of this field type can be configured with three options: -|Name|Type|Default value|Description| -|------|------|------|------| -|`selectionMethod`|`int`|`Relation\Type::SELECTION_BROWSE`| *This setting is not implemented yet, only one selection method is available.* | -|`selectionRoot`|`string`|`null`|This setting defines the selection root.| -|`selectionContentTypes`|`array`|`[]`|An array of content type IDs that are allowed for related Content.| +| Name | Type | Default value | Description | +|-------------------------|----------|-----------------------------------|--------------------------------------------------------------------------------| +| `selectionMethod` | `int` | `Relation\Type::SELECTION_BROWSE` | *This setting is not implemented yet, only one selection method is available.* | +| `selectionRoot` | `string` | `null` | This setting defines the selection root. | +| `selectionContentTypes` | `array` | `[]` | An array of content type IDs that are allowed for related Content. | ``` php // Relation FieldType example settings diff --git a/docs/content_management/field_types/field_type_reference/relationlistfield.md b/docs/content_management/field_types/field_type_reference/relationlistfield.md index 86ef67f760..bf1bde0d1a 100644 --- a/docs/content_management/field_types/field_type_reference/relationlistfield.md +++ b/docs/content_management/field_types/field_type_reference/relationlistfield.md @@ -4,9 +4,9 @@ This field type makes it possible to store and retrieve values of a relation to | Name | Internal name | Expected input | |----------------|------------------------|----------------| -| `RelationList` | `ezobjectrelationlist` | `mixed` | +| `RelationList` | `ibexa_object_relation_list` | `mixed` | -## PHP API field type  +## PHP API field type ### Input expectations @@ -21,7 +21,7 @@ This field type makes it possible to store and retrieve values of a relation to ##### Properties -`Ibexa\Core\FieldType\RelationList\Value` contains the following properties: +`Ibexa\Core\FieldType\RelationList\Value` contains the following properties: |Property|Type|Description|Example| |------|------|------|------| @@ -38,7 +38,7 @@ $relationList->destinationContentId = [ ##### Constructor -The `RelationList\Value` constructor initializes a new value object with the value provided. +The `RelationList\Value` constructor initializes a new value object with the value provided. It expects a mixed array as value. ``` php diff --git a/docs/content_management/field_types/field_type_reference/richtextfield.md b/docs/content_management/field_types/field_type_reference/richtextfield.md index c4c5f6e8a1..0f6605a0ba 100644 --- a/docs/content_management/field_types/field_type_reference/richtextfield.md +++ b/docs/content_management/field_types/field_type_reference/richtextfield.md @@ -2,11 +2,11 @@ The RichText field type is available via the RichText field type Bundle provided by the [ibexa/fieldtype-richtext](https://github.com/ibexa/fieldtype-richtext) package. -This field type validates and stores structured rich text, and exposes it in several formats. +This field type validates and stores structured rich text in [DocBook](https://docbook.org/) XML format, and exposes it in several formats. -|Name|Internal name|Expected input| -|------|------|------| -|`RichText`|`ezrichtext`|mixed| +| Name | Internal name | Expected input | +|------------|------------------|----------------| +| `RichText` | `ibexa_richtext` | mixed | ## PHP API field type @@ -14,17 +14,17 @@ This field type validates and stores structured rich text, and exposes it in sev `Ibexa\FieldTypeRichText\FieldType\RichText\Value` offers the following properties: -|Property|Type|Description| -|------|------|------| -|`xml`|`DOMDocument`|Internal format value as an instance of `DOMDocument`.| +| Property | Type | Description | +|----------|---------------|--------------------------------------------------------| +| `xml` | `DOMDocument` | Internal format value as an instance of `DOMDocument`. | ### Input expectations -|Type|Description| -|------|------| -|`string`|XML document in one of the field type's input formats as a string.| -|`DOMDocument`|XML document in one of the field type's input formats as a `DOMDocument` object.| -|`Ibexa\FieldTypeRichText\FieldType\RichText\Value`|An instance of the field type's `Value` object.| +| Type | Description | +|----------------------------------------------------|----------------------------------------------------------------------------------| +| `string` | XML document in one of the field type's input formats as a string. | +| `DOMDocument` | XML document in one of the field type's input formats as a `DOMDocument` object. | +| `Ibexa\FieldTypeRichText\FieldType\RichText\Value` | An instance of the field type's `Value` object. | ##### Input formats @@ -39,12 +39,12 @@ As its internal format, the RichText field type uses a [custom flavor of the Doc ``` xml
- This is a title. - This is a paragraph. + xmlns="http://docbook.org/ns/docbook" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:ezxhtml="http://ibexa.co/xmlns/dxp/docbook/xhtml" + xmlns:ezcustom="http://ibexa.co/xmlns/dxp/docbook/custom" version="5.0-variant ezpublish-1.0"> + This is a title. + This is a paragraph.
``` @@ -285,4 +285,3 @@ Elements of the Online Editor correspond to the following sample DocBook code bl ``` - diff --git a/docs/content_management/field_types/field_type_reference/selectionfield.md b/docs/content_management/field_types/field_type_reference/selectionfield.md index bff58da6ab..5eefa48d1c 100644 --- a/docs/content_management/field_types/field_type_reference/selectionfield.md +++ b/docs/content_management/field_types/field_type_reference/selectionfield.md @@ -1,17 +1,17 @@ # Selection field type -The Selection field type stores single selections or multiple choices from a list of options, by populating a hash with the list of selected values. +The Selection field type stores single selections or multiple choices from a list of options, by populating a hash with the list of selected values. -| Name | Internal name | Expected input type | -|-------------|---------------|---------------------| -| `Selection` | `ezselection` | mixed | +| Name | Internal name | Expected input type | +|-------------|-------------------|---------------------| +| `Selection` | `ibexa_selection` | mixed | ## PHP API field type ### Input expectations -| Type | Example | -|---------|-----------------| +| Type | Example | +|---------|------------| | `array` | `[ 1, 2 ]` | ### Value object @@ -20,8 +20,8 @@ The Selection field type stores single selections or multiple choices from a The Value class of this field type contains the following properties: -| Property | Type | Description| -|--------------|---------|------------| +| Property | Type | Description | +|--------------|---------|-------------------------------------------------------------------------------------------------------------------| | `$selection` | `int[]` | This property is used for the list of selections, which is a list of integer values, or one single integer value. | ``` php @@ -36,7 +36,7 @@ $value->selection = [ 1, 4, 5 ]; ##### Constructor -The `Selection\Value` constructor accepts an array of selected element identifiers. +The `Selection\Value` constructor accepts an array of selected element identifiers. ``` php // Constructor example @@ -64,7 +64,7 @@ $hash = [ 1, 2 ]; ### Validation This field type validates the input, verifying if all selected options exist in the field definition and checks if multiple selections are allowed in the field definition. -If any of these validations fail, a `ValidationError` is thrown, specifying the error message. +If any of these validations fail, a `ValidationError` is thrown, specifying the error message. When option validation fails, a list with the invalid options is also presented. ### Settings diff --git a/docs/content_management/field_types/field_type_reference/sesexternaldata.md b/docs/content_management/field_types/field_type_reference/sesexternaldata.md deleted file mode 100644 index e5465c373d..0000000000 --- a/docs/content_management/field_types/field_type_reference/sesexternaldata.md +++ /dev/null @@ -1,19 +0,0 @@ -# SesExternalData - -Field type `sesexternaldatatype` uses external storage to store data. -The data is stored in the `ses_externaldata` table with the following structure: - -|Field|Type|Description| -|--- |--- |--- | -|`sku`|char(40)|Unique ID of the Product category (CatalogElement).| -|`identifier`|char(40)|ID of the field.| -|`language_code`|char(8)|Language code, for example, `ger-DE`.| -|`ses_field_type`|char(20)|The data type used for this data.| -|`content`|longtext|Serialized data in string format.| - -## Storing data in `ses_externaldata` - -Data that is stored in the `ses_externaldata` table must be either a simple datatype: int, float, bool, or a field type. - -Field type data is stored in the database in serialized form by using the `toHash()` method. -Simple data types (int, float, bool) are stored in serialized form. diff --git a/docs/content_management/field_types/field_type_reference/sesprofiledata.md b/docs/content_management/field_types/field_type_reference/sesprofiledata.md deleted file mode 100644 index c836bbd15b..0000000000 --- a/docs/content_management/field_types/field_type_reference/sesprofiledata.md +++ /dev/null @@ -1,11 +0,0 @@ -# SesProfileData - -This field type stores [`CustomerProfileData`] in the User content type. - -`CustomerProfileData` must be stored as a serialized string in base64 format, -because it's impossible to store special HTML characters (`<`,`>`, `""`,`''`, `&`) in a text or text area field. - -The name of the customer (taken from the contact section) can be used for lists. -To do it, use the name pattern in the content type definition of the User content type. - -`customer_profile_data` is the identifier of the field where the profile data is stored. diff --git a/docs/content_management/field_types/field_type_reference/sesselection.md b/docs/content_management/field_types/field_type_reference/sesselection.md deleted file mode 100644 index b978a19e71..0000000000 --- a/docs/content_management/field_types/field_type_reference/sesselection.md +++ /dev/null @@ -1,22 +0,0 @@ -# SesSelection - -This field type stores a single selection choice. - -The SesSelection field type is configured in a YAML file, unlike the [Selection field type](selectionfield.md). -This way, you can set up SiteAccess-specific selection field types. - -The field type must be configured per attribute: - -``` yaml -ibexa.commerce.site_access.config.core.default.sesselection.news_type: - default: general - translation_context: news - options: - general: general - sports: sports - culture: culture -``` - -The `translation_context` key, which identifies the context used for translating the labels, is optional. - -To add a SesSelection field to a content type, make sure the field's identifier is the same as the configuration key (in the example above, `news_type`). diff --git a/docs/content_management/field_types/field_type_reference/specificationstype.md b/docs/content_management/field_types/field_type_reference/specificationstype.md deleted file mode 100644 index 205526c3b6..0000000000 --- a/docs/content_management/field_types/field_type_reference/specificationstype.md +++ /dev/null @@ -1,40 +0,0 @@ -# SpecificationsType - -This field type stores a structured list of attributes for products. - -!!! caution "Field naming" - - A field of the SpecificationsType must have `ses_specifications` as its field identifier. - -The data is stored in JSON format. - -``` json -[ - { - "name": "marketing", - "data": [ - { - "label": "Brand", - "value": "MG" - }, - { - "label": "Warranty", - "value": "2yrs" - } - ] - }, - { - "name": "technic", - "data": [ - { - "label": "Size", - "value": "12cm" - }, - { - "label": "color", - "value": "red" - } - ] - } -] -``` diff --git a/docs/content_management/field_types/field_type_reference/taxonomyentryassignmentfield.md b/docs/content_management/field_types/field_type_reference/taxonomyentryassignmentfield.md index d7e96e85fe..476c043d1f 100644 --- a/docs/content_management/field_types/field_type_reference/taxonomyentryassignmentfield.md +++ b/docs/content_management/field_types/field_type_reference/taxonomyentryassignmentfield.md @@ -8,19 +8,18 @@ This field type assigns tags to the content in the data action, so then you can Because tags are assigned per content item, not per field, you cannot use two **Taxonomy Entry Assignment** fields with the same taxonomy type in one content type. - To be able to assign tags to the content, first, you need to add a `TaxonomyEntryAssignment` field to the content type definition. -| Name | Internal name | Expected input | -|--------------------------|----------------------------------|----------------| -| `TaxonomyEntryAssignment`| `ibexa_taxonomy_entry_assignment`| array with `taxonomyEntries` and `taxonomy` keys| +| Name | Internal name | Expected input | +|---------------------------|-----------------------------------|--------------------------------------------------| +| `TaxonomyEntryAssignment` | `ibexa_taxonomy_entry_assignment` | array with `taxonomyEntries` and `taxonomy` keys | -## PHP API field type  +## PHP API field type ### Input expectations -| Type | Description | Example | -|--------|-----------------|-----------------| +| Type | Description | Example | +|---------|---------------------------------------------------------------------------------------------------------------------------------------------|-----------| | `array` | array with `Ibexa\Contracts\Taxonomy\Value\TaxonomyEntry` objects under `taxonomy_entries` key and Taxonomy identifier under `taxonomy` key | see below | Example using an `Ibexa\Taxonomy\FieldType\TaxonomyEntryAssignment\Value` object: @@ -76,9 +75,9 @@ The field type validates if all Taxonomy Entries from the value are assigned to #### Settings -Name|Type|Default value|Description| -|------|------|------|------| -|`taxonomy`|`string`|`null`|Taxonomy from which entry is chosen.| +| Name | Type | Default value | Description | +|------------|----------|---------------|--------------------------------------| +| `taxonomy` | `string` | `null` | Taxonomy from which entry is chosen. | #### Template rendering diff --git a/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md b/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md index 444e97d0a9..1fdbb9ec8b 100644 --- a/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md +++ b/docs/content_management/field_types/field_type_reference/taxonomyentryfield.md @@ -6,7 +6,7 @@ TaxonomyEntry is a field type that stores information about the parent entry in |----------------|-----------------------|----------------| | `TaxonomyEntry`| `ibexa_taxonomy_entry`| `array`| -## PHP API field type  +## PHP API field type ### Input expectations diff --git a/docs/content_management/field_types/field_type_reference/textblockfield.md b/docs/content_management/field_types/field_type_reference/textblockfield.md index 7c1ed868d3..859fb35195 100644 --- a/docs/content_management/field_types/field_type_reference/textblockfield.md +++ b/docs/content_management/field_types/field_type_reference/textblockfield.md @@ -1,18 +1,18 @@ # TextBlock field type -The field type handles a block of multiple lines of unformatted text. It's capable of handling up to 16,777,216 characters. +The field type handles a block of multiple lines of unformatted text. It's capable of handling up to 16,777,216 characters. | Name | Internal name | Expected input type | |-------------|---------------|---------------------| -| `TextBlock` | `eztext` | `string` | +| `TextBlock` | `ibexa_text` | `string` | ## PHP API field type ### Input expectations -|Type|Example| -|----|-------| -|`string`|`"This is a block of unformatted text"`| +| Type | Example | +|----------|-----------------------------------------| +| `string` | `"This is a block of unformatted text"` | ### Value object @@ -20,9 +20,9 @@ The field type handles a block of multiple lines of unformatted text. It's capa The Value class of this field type contains the following properties: -|Property|Type|Description| -|--------|----|-----------| -|`$text`|`string`|This property is used for the text content.| +| Property | Type | Description | +|----------|----------|---------------------------------------------| +| `$text` | `string` | This property is used for the text content. | ##### String representation @@ -31,7 +31,7 @@ A TextBlock's string representation is the `$text` property's value, as a string ##### Constructor The constructor for this value object initializes a new value object with the value provided. -It accepts a string as argument and imports it to the `$text` attribute. +It accepts a string as argument and imports it to the `$text` attribute. ### Validation @@ -41,6 +41,6 @@ This field type doesn't perform any special validation of the input value. Settings contain only one option: -| Name | Type | Default value | Description| -|------------|-----------|---------------|------------| +| Name | Type | Default value | Description | +|------------|-----------|---------------|---------------------------------------------------------------| | `textRows` | `integer` | `10` | Number of rows for the editing box in the back-end interface. | diff --git a/docs/content_management/field_types/field_type_reference/textlinefield.md b/docs/content_management/field_types/field_type_reference/textlinefield.md index 4b2e252344..7867869265 100644 --- a/docs/content_management/field_types/field_type_reference/textlinefield.md +++ b/docs/content_management/field_types/field_type_reference/textlinefield.md @@ -5,7 +5,7 @@ It's capable of handling up to 255 characters. | Name | Internal name | Expected input type | |------------|---------------|---------------------| -| `TextLine` | `ezstring` | `string` | +| `TextLine` | `ibexa_string` | `string` | ## PHP API field type @@ -15,8 +15,8 @@ It's capable of handling up to 255 characters. The Value class of this field type contains the following properties: -| Property | Type | Description| -|----------|----------|------------| +| Property | Type | Description | +|----------|----------|---------------------------------------------| | `$text` | `string` | This property is used for the text content. | ##### String representation @@ -26,7 +26,7 @@ A TextLine's string representation is the `$text` property's value, as a string. ##### Constructor The constructor for this value object initializes a new value object with the value provided. -It accepts a string as argument and imports it to the `$text` attribute. +It accepts a string as argument and imports it to the `$text` attribute. ### Validation @@ -35,10 +35,11 @@ The length of the string provided must be between the minimum length defined in The default value for both properties is 0, which means that the validation is disabled by default. To set the validation properties, the `validateValidatorConfiguration()` method needs to be inspected, which receives an array with `minStringLength` and `maxStringLength` like in the following representation: -``` -Array -( - [minStringLength] => 1 - [maxStringLength] => 60 -) +```php +[ + 'StringLengthValidator' => [ + 'maxStringLength' => 60 + 'minStringLength' => 1 + ] +] ``` diff --git a/docs/content_management/field_types/field_type_reference/timefield.md b/docs/content_management/field_types/field_type_reference/timefield.md index 370d836f7a..8fc0bd7916 100644 --- a/docs/content_management/field_types/field_type_reference/timefield.md +++ b/docs/content_management/field_types/field_type_reference/timefield.md @@ -8,7 +8,7 @@ What is stored is the number of seconds, calculated from the beginning of the da | Name | Internal name | Expected input type | |--------|---------------|---------------------| -| `Time` | `eztime` | mixed | +| `Time` | `ibexa_time` | mixed | ## PHP API field type @@ -18,11 +18,11 @@ If input value is of type `string` or `integer`, it's passed directly to the [PH It's also possible to directly pass an instance of `\DateTime`. -|Type|Example| -|------|------| -|`string`|`"2012-08-28 12:20 Europe/Berlin"`| -|`integer`|`1346149200`| -|`\DateTime`|`new \DateTime()`| +| Type | Example | +|-------------|------------------------------------| +| `string` | `"2012-08-28 12:20 Europe/Berlin"` | +| `integer` | `1346149200` | +| `\DateTime` | `new \DateTime()` | ### Value object @@ -30,8 +30,8 @@ It's also possible to directly pass an instance of `\DateTime`. The Value class of this field type contains the following properties: -| Property | Type | Description| -|----------|----------------|------------| +| Property | Type | Description | +|----------|----------------|-----------------------------------------------------------------------------------| | `$time` | `integer|null` | Holds the time information as a number of seconds since the beginning of the day. | ##### Constructor @@ -41,13 +41,13 @@ It accepts an integer representing the number of seconds since the beginning of ##### String representation -String representation of the date value generates the date string in the format "H:i:s" as accepted by [PHP's built-in `date()` function](https://www.php.net/manual/en/function.date.php). +String representation of the date value generates the date string in the format "H:i:s" as accepted by [PHP's built-in `date()` function](https://www.php.net/manual/en/function.date.php). -|Character|Description|Example| -|---------|----------|--------| -|H|Two digit representation of an hour, 24-hour format, range 00 to 23 |12| -|i|Two digit representation of minutes, range 00 to 59|14| -|s|Two digit representation of seconds, range 00 to 59|56| +| Character | Description | Example | +|-----------|---------------------------------------------------------------------|---------| +| H | Two digit representation of an hour, 24-hour format, range 00 to 23 | 12 | +| i | Two digit representation of minutes, range 00 to 59 | 14 | +| s | Two digit representation of seconds, range 00 to 59 | 56 | Example: `"12:14:56"` @@ -65,10 +65,10 @@ This field type doesn't perform validation of the input value. The Field definition of this field type can be configured with several options: -|Name|Type|Default value|Description| -|------|------|------|------| -|`useSeconds`|`boolean`|`false`|Used to control displaying of seconds in the output.| -|`defaultType`|`Type::DEFAULT_EMPTY Type::DEFAULT_CURRENT_TIME`|`Type::DEFAULT_EMPTY`|The constant used here defines default input value when using back-end interface.| +| Name | Type | Default value | Description | +|---------------|--------------------------------------------------|-----------------------|-----------------------------------------------------------------------------------| +| `useSeconds` | `boolean` | `false` | Used to control displaying of seconds in the output. | +| `defaultType` | `Type::DEFAULT_EMPTY Type::DEFAULT_CURRENT_TIME` | `Type::DEFAULT_EMPTY` | The constant used here defines default input value when using back-end interface. | ``` php // Time field type example settings @@ -81,14 +81,14 @@ $settings = [ ## Template rendering -The template called by [the `ibexa_render_field()` Twig function](field_twig_functions.md#ibexa_render_field) while rendering a Date field has access to the following parameters: +The template called by [the `ibexa_render_field()` Twig function](field_twig_functions.md#ibexa_render_field) while rendering a Date field has access to the following parameters: -| Parameter | Type | Default | Description| -|-----------|----------|---------|------------| -| `locale` | `string` |   n/a | Internal parameter set by the system based on current request locale or, if not set, calculated based on the language of the field. | +| Parameter | Type | Default | Description | +|-----------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------| +| `locale` | `string` | n/a | Internal parameter set by the system based on current request locale or, if not set, calculated based on the language of the field. | Example: -``` php +``` twig {{ ibexa_render_field(content, 'time') }} ``` diff --git a/docs/content_management/field_types/field_type_reference/urlfield.md b/docs/content_management/field_types/field_type_reference/urlfield.md index b9ead6f12c..5a29baa0e2 100644 --- a/docs/content_management/field_types/field_type_reference/urlfield.md +++ b/docs/content_management/field_types/field_type_reference/urlfield.md @@ -5,16 +5,16 @@ It's formed by the combination of a link and the respective text. | Name | Internal name | Expected input | |-------|---------------|----------------| -| `Url` | `ezurl` | `string` | +| `Url` | `ibexa_url` | `string` | ## PHP API field type ### Input expectations -|Type|Description|Example| -|------|------|------| -|`string`|Link content provided to the value.|"https://www.ibexa.co"| -|`string`|Text content that represents the stored link.|"Ibexa"| +| Type | Description | Example | +|----------|-----------------------------------------------|------------------------| +| `string` | Link content provided to the value. | "https://www.ibexa.co" | +| `string` | Text content that represents the stored link. | "Ibexa" | ### Value object @@ -22,8 +22,8 @@ It's formed by the combination of a link and the respective text. The Value class of this field type contains the following properties: -| Property | Type | Description| -|----------|----------|------------| +| Property | Type | Description | +|----------|----------|------------------------------------------------------------------------------------------------------| | `$link` | `string` | This property stores the link provided to the value of this field type. | | `$text` | `string` | This property stores the text to represent the stored link provided to the value of this field type. | @@ -36,7 +36,7 @@ $url->text = "Ibexa"; ##### Constructor -The `Url\Value` constructor initializes a new value object with the provided value. +The `Url\Value` constructor initializes a new value object with the provided value. It expects two comma-separated strings, corresponding to the link and text. ``` php @@ -58,13 +58,14 @@ $hash = [ "link" => "https://www.ibexa.co/", "text" => "Ibexa" ]; - ``` ### Validation This field type doesn't perform validation. +But some validation can be made afterward, see [External URL validation](url_management.md#external-url-validation) for more information. + ### Settings This field type doesn't have settings. diff --git a/docs/content_management/field_types/field_type_reference/userfield.md b/docs/content_management/field_types/field_type_reference/userfield.md index e1ffad6c99..7fb1e258e0 100644 --- a/docs/content_management/field_types/field_type_reference/userfield.md +++ b/docs/content_management/field_types/field_type_reference/userfield.md @@ -4,38 +4,26 @@ This field type validates and stores information about a user. | Name | Internal name | Expected input | |--------|---------------|----------------| -| `User` | `ezuser` | ignored | +| `User` | `ibexa_user` | ignored | ## PHP API field type ### Value object -|Property|Type|Description|Example| -|------|------|------|------| -|`hasStoredLogin`|`boolean`|Denotes if user has stored login.|`true`| -|`contentId`|`int|string`|ID of the content item corresponding to the user.|`42`| -|`login`|`string`|Username.|`john`| -|`email`|`string`|The user's email address.|`john@smith.com`| -|`passwordHash`|`string`|Hash of the user's password.|`1234567890abcdef`| -|`passwordHashType`|`mixed`|Algorithm user for generating password hash as a `PASSWORD_HASH_*` constant defined in `Ibexa\Contracts\Core\Repository\Values\User\User` class.|`User::PASSWORD_HASH_PHP_DEFAULT`| -|`maxLogin`|`int`|Maximum number of concurrent logins.|`1000`| +| Property | Type | Description | Example | +|--------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------| +| `hasStoredLogin` | `boolean` | Denotes if user has stored login. | `true` | +| `contentId` | `int | string` | ID of the content item corresponding to the user. |`42`| +| `login` | `string` | Username. | `john` | +| `email` | `string` | The user's email address. | `john@smith.com` | +| `passwordHash` | `string` | Hash of the user's password. | `1234567890abcdef` | +| `passwordHashType` | `mixed` | Algorithm user for generating password hash as a `PASSWORD_HASH_*` constant defined in `Ibexa\Contracts\Core\Repository\Values\User\User` class. | `User::PASSWORD_HASH_PHP_DEFAULT` | +| `maxLogin` | `int` | Maximum number of concurrent logins. | `1000` | ##### Available password hash types -|Constant|Description| -|------|------| -|`Ibexa\Contracts\Core\Repository\Values\User\User::DEFAULT_PASSWORD_HASH`|Default password hash, used when none is specified, may change over time.| -|`Ibexa\Contracts\Core\Repository\Values\User\User::PASSWORD_HASH_PHP_DEFAULT`|Passwords hashed by PHP's default algorithm, which may change over time.| -|`Ibexa\Contracts\Core\Repository\Values\User\User::PASSWORD_HASH_BCRYPT`|Bcrypt hash of the password.| - -!!! caution - - Old password hash types like MD5 have numerical hash type value from 1 to 5. - These types were deprecated in v1.13 and removed in v3.0. - Between v1.13 and v3.0 it was possible to update hashes automatically when users logged in. - Since v3.0, login is only possible with hash type 6 or larger. - Automatic updates of older types on login aren't possible anymore. - A mass migration of all hashes has never been possible, because this would require knowing the passwords, which only users themselves do. - Users who still have an old, unsupported password hash type can request a new, valid password using the "Forgot password" feature. - - Removal notice: https://doc.ibexa.co/en/latest/release_notes/ez_platform_v3.0_deprecations/#password-hashes +| Constant | Description | +|-------------------------------------------------------------------------------|---------------------------------------------------------------------------| +| `Ibexa\Contracts\Core\Repository\Values\User\User::DEFAULT_PASSWORD_HASH` | Default password hash, used when none is specified, may change over time. | +| `Ibexa\Contracts\Core\Repository\Values\User\User::PASSWORD_HASH_PHP_DEFAULT` | Passwords hashed by PHP's default algorithm, which may change over time. | +| `Ibexa\Contracts\Core\Repository\Values\User\User::PASSWORD_HASH_BCRYPT` | Bcrypt hash of the password. | diff --git a/mkdocs.yml b/mkdocs.yml index 124a47ec94..1b36ac9ca6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -267,14 +267,11 @@ nav: - Media field type: content_management/field_types/field_type_reference/mediafield.md - Null field type: content_management/field_types/field_type_reference/nullfield.md - Page field type: content_management/field_types/field_type_reference/pagefield.md + - ProductSpecification field type: content_management/field_types/field_type_reference/productspecificationfield.md - Relation field type: content_management/field_types/field_type_reference/relationfield.md - RelationList field type: content_management/field_types/field_type_reference/relationlistfield.md - RichText field type: content_management/field_types/field_type_reference/richtextfield.md - Selection field type: content_management/field_types/field_type_reference/selectionfield.md - - SesExternalData: content_management/field_types/field_type_reference/sesexternaldata.md - - SesProfileData: content_management/field_types/field_type_reference/sesprofiledata.md - - SesSelection: content_management/field_types/field_type_reference/sesselection.md - - SpecificationsType: content_management/field_types/field_type_reference/specificationstype.md - TaxonomyEntry field type: content_management/field_types/field_type_reference/taxonomyentryfield.md - TaxonomyEntryAssignment field type: content_management/field_types/field_type_reference/taxonomyentryassignmentfield.md - TextBlock field type: content_management/field_types/field_type_reference/textblockfield.md diff --git a/plugins.yml b/plugins.yml index 06788f7194..583304b7d0 100644 --- a/plugins.yml +++ b/plugins.yml @@ -164,10 +164,14 @@ plugins: 'api/field_types_reference/relationlistfield.md': 'content_management/field_types/field_type_reference/relationlistfield.md' 'api/field_types_reference/richtextfield.md': 'content_management/field_types/field_type_reference/richtextfield.md' 'api/field_types_reference/selectionfield.md': 'content_management/field_types/field_type_reference/selectionfield.md' - 'api/field_types_reference/sesexternaldata.md': 'content_management/field_types/field_type_reference/sesexternaldata.md' - 'api/field_types_reference/sesprofiledata.md': 'content_management/field_types/field_type_reference/sesprofiledata.md' - 'api/field_types_reference/sesselection.md': 'content_management/field_types/field_type_reference/sesselection.md' - 'api/field_types_reference/specificationstype.md': 'content_management/field_types/field_type_reference/specificationstype.md' + 'api/field_types_reference/sesexternaldata.md': 'content_management/field_types/field_type_reference/field_type_reference.md' + 'content_management/field_types/field_type_reference/sesexternaldata.md': 'content_management/field_types/field_type_reference/field_type_reference.md' + 'api/field_types_reference/sesprofiledata.md': 'content_management/field_types/field_type_reference/field_type_reference.md' + 'content_management/field_types/field_type_reference/sesprofiledata.md': 'content_management/field_types/field_type_reference/field_type_reference.md' + 'api/field_types_reference/sesselection.md': 'content_management/field_types/field_type_reference/productspecificationfield.md' + 'content_management/field_types/field_type_reference/sesselection.md': 'content_management/field_types/field_type_reference/productspecificationfield.md' + 'api/field_types_reference/specificationstype.md': 'content_management/field_types/field_type_reference/productspecificationfield.md' + 'content_management/field_types/field_type_reference/specificationstype.md': 'content_management/field_types/field_type_reference/productspecificationfield.md' 'api/field_types_reference/textblockfield.md': 'content_management/field_types/field_type_reference/textblockfield.md' 'api/field_types_reference/textlinefield.md': 'content_management/field_types/field_type_reference/textlinefield.md' 'api/field_types_reference/timefield.md': 'content_management/field_types/field_type_reference/timefield.md'