### Flux Grid API Example Source: https://github.com/fluidtypo3/flux/blob/development/README.md Illustrates how to define a content grid structure using Flux within a Fluid template. This enables the creation of nested content areas, allowing for more complex layouts and content organization in the TYPO3 backend. It requires the Flux extension to be installed and enabled. ```xml ``` -------------------------------- ### Install Flux TYPO3 Extension Source: https://context7.com/fluidtypo3/flux/llms.txt Installs the Flux TYPO3 extension using Composer and then activates it via the command line. Alternatively, it can be activated through the TYPO3 backend's Extension Manager. ```bash # Install via Composer (recommended) composer req fluidtypo3/flux ./vendor/bin/typo3 extension:install flux # Or activate via Extension Manager in TYPO3 backend ``` -------------------------------- ### Flux form.content ViewHelper with flux:grid Comparison Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Form/Content.rst This example contrasts the usage of flux:form.content with flux:grid. It shows how flux:grid creates a multi-column/row structure and that no flux:content can be used after flux:grid. ```html ``` -------------------------------- ### Flux Form API Example Source: https://github.com/fluidtypo3/flux/blob/development/README.md Demonstrates how to define a custom form field within a Fluid template using Flux. This allows for the creation of custom input fields in the TYPO3 backend for content elements or page properties. It requires the Flux extension to be installed and enabled. ```xml ``` -------------------------------- ### Inline Fluid Rendering with Flux ViewHelper Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Inline.rst This example demonstrates how to use the `flux:inline` ViewHelper to render Fluid code stored in a variable. It shows assigning a variable and then rendering it using the ViewHelper in the template. This is useful for passing dynamic Fluid snippets to templates. ```php $view->assign('variable', 'value of my variable'); $view->assign('code', 'My variable: {variable}'); ``` ```fluid {code -> flux:inline()} ``` -------------------------------- ### Flux form.content ViewHelper Basic Usage Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Form/Content.rst This example demonstrates the basic usage of the flux:form.content ViewHelper to create a single content area named 'mycontent'. It shows how Flux uses this single content area and that additional flux:content tags are ignored. ```html ``` -------------------------------- ### Render Child Content with Flux ViewHelper Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Content/Get.rst This example demonstrates how to use the flux:content.get ViewHelper to retrieve child content elements from a 'teaser' area and render them with a red border. It iterates through the elements and applies raw formatting. ```html
{element}
``` -------------------------------- ### flux:form.object.columnPosition Usage Example Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Form/Object/ColumnPosition.rst This example demonstrates how to use the flux:form.object.columnPosition ViewHelper within a flux:form definition to manage section objects and their corresponding column positions. It shows the integration with flux:grid.column for rendering dynamic grids based on these section objects. ```html ``` -------------------------------- ### Register and Get Values from Compatibility Registry (PHP) Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/Changelog/7.3.0.md Demonstrates how to use the Compatibility Registry to register version-specific class names and retrieve the appropriate class name based on the current TYPO3 version. This utility ensures uniform version checks and consistent value retrieval. ```php \FluidTYPO3\Flux\Utility\CompatibilityRegistry::register( 'MyVendor\MyExtension\MyClass', array( '7.4.0' => 'MyVendor\MyExtension\Legacy\MyClass', '7.6.0' => 'MyVendor\MyExtension\MyClass' ) ); \FluidTYPO3\Flux\Utility\CompatibilityRegistry::get('MyVendor\MyExtension\MyClass'); ``` -------------------------------- ### Custom Data Transformer Implementation in Flux Source: https://github.com/fluidtypo3/flux/blob/development/README.md Provides a PHP code example for creating a custom data transformer in Flux using PHP 8.0 attributes. This allows for complex data transformations beyond the built-in types. ```php ` ViewHelper to enforce that an argument named 'name' is not empty. It's placed within the `` tag. Validation errors are then checked and displayed using standard Fluid tags. ```html {error.code}: {error.message} ``` -------------------------------- ### Flux field.relation ViewHelper Example: Select Content Element Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Field/Relation.rst This example demonstrates how to use the field.relation ViewHelper to select a content element from the current page. It specifies the target table ('tt_content') and a condition to filter records based on the current page's UID. The 'condition' argument accepts a list of allowed markers documented in the TYPO3 TCAReference. ```html ``` -------------------------------- ### Render Child Content of a Grid Column using Flux Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Content/Render.rst This example demonstrates how to use the flux:content.render ViewHelper to render all child content elements within a grid column named 'teaser'. The parent element has a red border for visual identification. This is useful for organizing and displaying content blocks within a page layout. ```html
``` -------------------------------- ### Group Fields with flux:form.container Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Form/Container.rst This example demonstrates how to use the flux:form.container ViewHelper to group input fields. The container organizes fields like 'firstname' and 'lastname' under a 'settings.name' scope, making them accessible as {settings.name.firstname} and {settings.name.lastname} in Fluid templates. The 'name' argument is required to define the scope, while 'label' provides a user-friendly title. ```html ``` -------------------------------- ### Create Flux Form using JSON/Array Input Source: https://github.com/fluidtypo3/flux/blob/development/README.md Shows how to initialize a Flux form from a JSON string or a PHP array. This is useful for dynamic form generation or when form structures are stored externally. ```php $json = '{name: "myform", fields: [{"name": "myField", "type": "Input"}]}'; $asArray = json_decode($json, JSON_OBJECT_AS_ARRAY); $form = \FluidTYPO3\Flux\Form::create($asArray); ``` -------------------------------- ### Transform Field Value to Boolean in Flux Source: https://github.com/fluidtypo3/flux/blob/development/README.md Example of using the 'transform' attribute in a Flux form field to automatically convert the input value to a boolean type. This ensures data consistency between form input and template variables. ```xml ``` -------------------------------- ### Select and Render File with flux:field.file Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Field/File.rst This snippet demonstrates how to use the flux:field.file ViewHelper to select a file (e.g., an image) and then render it using the f:image ViewHelper. It highlights the 'allowed' and 'showThumbnails' attributes for file selection configuration. ```html ``` -------------------------------- ### Select Records from Multiple Tables with flux:field.multiRelation Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Field/MultiRelation.rst This example demonstrates how to use the flux:field.multiRelation ViewHelper to select records from multiple tables, such as 'pages' and 'tt_content'. It configures the field to accept a maximum of 5 items. ```fluid ``` -------------------------------- ### Create Flux Form using PHP API Source: https://github.com/fluidtypo3/flux/blob/development/README.md Demonstrates how to programmatically create a Flux form and add fields using the PHP API. This method offers direct control over form generation within PHP scripts. ```php $form = \FluidTYPO3\Flux\Form::create(); $form->setName('myform'); $form->createField('Input', 'myField', 'My special field'); ``` -------------------------------- ### Generate Git Log for Release Changes Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/Changelog/9.6.1.md This command generates a formatted log of Git commits for a specific date range, filtering for feature, bugfix, and removal commits. It requires Git to be installed and accessible in the environment. ```bash git log --since="2022/05/01" --until="2022/05/02" --abbrev-commit --pretty='%ad %s (Commit %h by %an)' \ --date=short | egrep '(\[FEATURE|BUGFIX|REMOVAL])+' ``` -------------------------------- ### Flux Field Tree ViewHelper Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Field/Tree.rst This section details the arguments available for the `` ViewHelper, which is used to create tree (select supertype) FlexForm fields. ```APIDOC ## Flux Field Tree ViewHelper `` ### Description Tree (select supertype) FlexForm field ViewHelper. ### Method This is a ViewHelper, typically used within Flux templates. ### Endpoint N/A (ViewHelper) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```html ``` ### Response #### Success Response (200) N/A (ViewHelper output is rendered within the template) #### Response Example N/A ### Arguments - **name** (string) - Required - Name of the attribute, FlexForm XML-valid tag name string. - **label** (string) - Optional - Label for the attribute, can be LLL: value. Optional - if not specified, Flux tries to detect an LLL label named "flux.fluxFormId.fields.foobar" based on field name, in scope of extension rendering the Flux form. If field is in an object, use "flux.fluxFormId.objects.objectname.foobar" where "foobar" is the name of the field. - **default** (string) - Optional - Default value for this attribute. - **description** (string) - Optional - Field description. - **native** (boolean) - Optional - If TRUE, this field will treated as a native TCA field (requiring a matching SQL column). If the "name" of this field is an already existing field, that original field will be replaced by this field. If the field is a new field (which doesn't already exist in TCA). You can control where this field visually appears in the editing form by specifying the "position" argument, which supports the same syntax as \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes (after:X before:X and replace:X). Note that when declaring a field as "native" it will no longer be rendered as part of the FlexForm where Flux fields are normally rendered. - **position** (string) - Optional - Only applies if native=1. Specify where in the editing form this field should be, using the syntax of \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes (after:X before:X and replace:X). Additionally, allows you to specify a TCA sheet if you want this field to be positioned in a dedicated sheet. Examples: position="after:header", position="replace:header", position="after:header My Sheet". - **required** (boolean) - Optional - If TRUE, this attribute must be filled when editing the FCE. - **exclude** (boolean) - Optional - If TRUE, this field becomes an "exclude field" (see TYPO3 documentation about this). - **transform** (string) - Optional - Set this to transform your value to this type - integer, array (for csv values), float, DateTime, Vendor\MyExt\Domain\Model\Object or ObjectStorage with type hint. - **enabled** (boolean) - Optional - Default: true. If FALSE, disables the field in the FlexForm. - **requestUpdate** (boolean) - Optional - If TRUE, the form is force-saved and reloaded when field value changes. - **displayCond** (string) - Optional - Optional "Display Condition" (TCA style) for this particular field. See: https://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Index.html#displaycond - **inherit** (boolean) - Optional - Default: true. If TRUE, the value for this particular field is inherited - if inheritance is enabled by the ConfigurationProvider. - **inheritEmpty** (boolean) - Optional - Default: true. If TRUE, allows empty values (specifically excluding the number zero!) to be inherited - if inheritance is enabled by the ConfigurationProvider. - **clear** (boolean) - Optional - If TRUE, a "clear value" checkbox is displayed next to the field which when checked, completely destroys the current field value all the way down to the stored XML value. - **protect** (boolean) - Optional - If TRUE, this field is protected and cannot be overridden by inheritance. ``` -------------------------------- ### Access Grouped Field Values Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Form/Container.rst This snippet shows how to access the values of fields that have been grouped using the flux:form.container ViewHelper. The values are accessed using the defined scope and field names, for example, {settings.name.firstname} and {settings.name.lastname}. ```html Name: {settings.name.firstname} {settings.name.lastname} ``` -------------------------------- ### Field Options Documentation Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Field/Select.rst This section details various boolean and mixed type options that can be applied to Flux fields to control their behavior. ```APIDOC ## Field Options This document outlines various configuration options for fields within the Flux framework. ### inheritEmpty #### Description If TRUE, allows empty values (specifically excluding the number zero!) to be inherited - if inheritance is enabled by the ConfigurationProvider. #### DataType boolean #### Default true #### Required false ### clear #### Description If TRUE, a "clear value" checkbox is displayed next to the field which when checked, completely destroys the current field value all the way down to the stored XML value. #### DataType boolean #### Required false ### protect #### Description If TRUE, a "protect value" checkbox is displayed next to the field which when checked, protects the value from being changed if the (normally inherited) field value is changed in a parent record. Has no effect if "inherit" is disabled on the field. #### DataType boolean #### Required false ### variables #### Description Freestyle variables which become assigned to the resulting Component - can then be read from that Component outside this Fluid template and in other templates using the Form object from this template. #### DataType mixed #### Default array () #### Required false ### extensionName #### Description If provided, enables overriding the extension context for this and all child nodes. The extension name is otherwise automatically detected from rendering context. #### DataType string #### Required false ### config #### Description Raw TCA options - passed directly to "config" section of created field and overrides anything generated by the component itself. Can be used to provide options that Flux itself does not support, and can be used to pass root-level arguments for a "userFunc". #### DataType mixed #### Default array () #### Required false ### validate #### Description FlexForm-type validation configuration for this input. #### DataType string #### Default 'trim' #### Required false ### size #### Description Size of the selector box. #### DataType integer #### Default 1 #### Required false ### multiple #### Description If TRUE, allows selecting the same value multiple times. #### DataType boolean #### Required false ### minItems #### Description Minimum required number of items to be selected. #### DataType integer #### Required false ### maxItems #### Description Maximum allowed number of items to be selected. #### DataType integer #### Default 1 #### Required false ### itemListStyle #### Description Overrides the default list style when maxItems > 1. #### DataType string #### Required false ### selectedListStyle #### Description Overrides the default selected list style when maxItems > 1 and renderType is SelectSingle. #### DataType string #### Required false ### items #### Description Items for the selector; array / CSV / Traversable / Query supported. #### DataType mixed #### Required true ### emptyOption #### Description If not-FALSE, adds one empty option/value pair to the generated selector box and tries to use this property's value (cast to string) as label. #### DataType mixed #### Required false ### translateCsvItems #### Description If TRUE, attempts to resolve a LLL label for each value provided as CSV in "items" attribute using convention for lookup "$field.option.123" if given "123" as CSV item value. Field name is determined by normal Flux field name conventions. #### DataType boolean #### Required false ### itemsProcFunc #### Description Function for serving items. See TCA "select" field "itemsProcFunc" attribute. #### DataType string #### Required false ### renderType #### Description Rendering type as applies in FormEngine/TCA. #### DataType string #### Default 'selectSingle' #### Required false ``` -------------------------------- ### Flux Form Container ViewHelper Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Form/Container.rst Demonstrates how to use the flux:form.container ViewHelper to group fields and access their values. ```APIDOC ## Flux Form Container ViewHelper `` ### Description Use the `flux:form.container` ViewHelper around other Flux fields to visually group them and create nested variable scopes. Fields within a container will be accessible as properties of the container's name in Fluid templates. ### Method This is a ViewHelper, not a direct HTTP method. ### Endpoint N/A (ViewHelper) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None (ViewHelper attributes are used instead) ### Arguments - **name** (string) - Required - Name of the attribute, FlexForm XML-valid tag name string. - **label** (string) - Optional - Label for the attribute. Can be an LLL: value. If not specified, Flux attempts to detect an LLL label based on the field name. - **variables** (mixed) - Optional - Freestyle variables that become assigned to the resulting Component. - **extensionName** (string) - Optional - Overrides the extension context for this and all child nodes. Otherwise, the extension name is automatically detected from the rendering context. ### Request Example ```html ``` ### Response #### Success Response (200) N/A (This is a ViewHelper for rendering forms, not an API endpoint returning data). #### Response Example Accessing values of grouped elements in Fluid: ```html Name: {settings.name.firstname} {settings.name.lastname} ``` ``` -------------------------------- ### Content Element Selector with Autocomplete using flux:field.multiRelation and flux:wizard.suggest Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Field/MultiRelation.rst This example shows how to configure flux:field.multiRelation to act as a content element selector with an autocomplete feature. Instead of a popup, it provides a search interface for content elements, limited to 5 items. ```fluid ``` -------------------------------- ### Field Configuration Options Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Field/Inline/Fal.rst This section details various configuration options for fields in Flux, including maxItems, itemListStyle, selectedListStyle, items, emptyOption, translateCsvItems, itemsProcFunc, table, condition, mm, foreignField, foreignLabel, foreignSelector, foreignSortby, foreignDefaultSortby, foreignTableField, and foreignUnique. ```APIDOC ## Field Configuration Options ### Description This section details various configuration options for fields in Flux, including maxItems, itemListStyle, selectedListStyle, items, emptyOption, translateCsvItems, itemsProcFunc, table, condition, mm, foreignField, foreignLabel, foreignSelector, foreignSortby, foreignDefaultSortby, foreignTableField, and foreignUnique. ### Parameters #### Query Parameters - **maxItems** (integer) - Optional - Maxium allowed number of items to be selected. Default: 1 - **itemListStyle** (string) - Optional - Overrides the default list style when maxItems > 1 - **selectedListStyle** (string) - Optional - Overrides the default selected list style when maxItems > 1 and renderType is SelectSingle - **items** (mixed) - Optional - Items for the selector; array / CSV / Traversable / Query supported - **emptyOption** (mixed) - Optional - If not-FALSE, adds one empty option/value pair to the generated selector box and tries to use this property's value (cast to string) as label. - **translateCsvItems** (boolean) - Optional - If TRUE, attempts to resolve a LLL label for each value provided as CSV in "items" attribute using convention for lookup "$field.option.123" if given "123" as CSV item value. Field name is determined by normal Flux field name conventions - **itemsProcFunc** (string) - Optional - Function for serving items. See TCA "select" field "itemsProcFunc" attribute - **table** (string) - Optional - Define foreign table name to turn selector into a record selector for that table. Default: 'sys_file_reference' - **condition** (string) - Optional - Condition to use when selecting from "foreignTable", supports FlexForm `foreign_table_where` markers - **mm** (string) - Optional - Optional name of MM table to use for record selection - **foreignField** (string) - Optional - The foreign_field is the field of the child record pointing to the parent record. This defines where to store the uid of the parent record. Default: 'uid_foreign' - **foreignLabel** (string) - Optional - If set, it overrides the label set in TCA[foreign_table]['ctrl']['label'] for the inline-view. Default: 'uid_local' - **foreignSelector** (string) - Optional - A selector is used to show all possible child records that could be used to create a relation with the parent record. It will be rendered as a multi-select-box. On clicking on an item inside the selector a new relation is created. The foreign_selector points to a field of the foreign_table that is responsible for providing a selector-box this field on the foreign_table usually has the type "select" and also has a "foreign_table" defined. Default: 'uid_local' - **foreignSortby** (string) - Optional - Field on the child record (or on the intermediate table) that stores the manual sorting information. Default: 'sorting_foreign' - **foreignDefaultSortby** (string) - Optional - If a fieldname for `foreign_sortby` is defined, then this is ignored. Otherwise this is used as the "ORDER BY" statement to sort the records in the table when listed. - **foreignTableField** (string) - Optional - The field of the child record pointing to the parent record. This defines where to store the table name of the parent record. On setting this configuration key together with foreign_field, the child record knows what its parent record is - so the child record could also be used on other parent tables. Default: 'tablenames' - **foreignUnique** (string) - Optional - Field which must be uniue for all children of a parent record. ### Request Example ```json { "maxItems": 5, "itemListStyle": "list", "items": [ "1,Option 1", "2,Option 2" ] } ``` ### Response #### Success Response (200) - **message** (string) - Indicates successful processing of the field configuration. #### Response Example ```json { "message": "Field configuration updated successfully." } ``` ``` -------------------------------- ### Flux Grid Row ViewHelper Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Grid/Row.rst Documentation for the `` ViewHelper, used to define rows within a grid layout. It accepts several arguments to customize the row's behavior and appearance. ```APIDOC ## Flux Grid Row ViewHelper `` ### Description This ViewHelper is used inside `` tags to define a row within a grid layout. It typically contains `` tags to define the columns within that row. ### Method Fluid ViewHelper ### Endpoint N/A (This is a ViewHelper, not a REST endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None (This is a ViewHelper, not a data submission endpoint) ### Request Example ```html ``` ### Response #### Success Response (200) N/A (This ViewHelper renders HTML content within a Fluid template, it does not return a direct response like an API endpoint.) #### Response Example N/A ### Arguments #### Path Parameters None #### Query Parameters None #### Request Body None ### Arguments #### name - **name** (string) - Optional - Defaults to 'row'. Optional name of this row. #### label - **label** (string) - Optional - Optional label for this row. Defaults to an LLL value. #### variables - **variables** (mixed) - Optional - Defaults to an empty array. Freestyle variables which become assigned to the resulting Component. #### extensionName - **extensionName** (string) - Optional - If provided, enables overriding the extension context for this and all child nodes. ``` -------------------------------- ### Render Content Columns using v:content.render Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Grid.rst This snippet shows how to render content from specific columns using the `v:content.render` ViewHelper. It's used in conjunction with the Flux grid layout to display content defined in different columns on the frontend. ```html ``` -------------------------------- ### Render Nested Content with Flux Source: https://context7.com/fluidtypo3/flux/llms.txt Renders child content elements placed in a specific grid area. Examples show default rendering, rendering with limits and custom sorting, and retrieving content as an array for custom iteration and display, including conditional styling for the first item. ```xml
{element.bodytext -> f:format.html()}
``` -------------------------------- ### Define Grid Layout with Flux Grid ViewHelper Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Grid.rst This snippet demonstrates how to define a grid layout using the `` ViewHelper, including nested `` and `` tags. It specifies column properties like `colPos`, `name`, `colspan`, and `style` to create a two-column layout. ```html ``` -------------------------------- ### Safely Load Data with flux:form.data and Page Accessibility Check Source: https://github.com/fluidtypo3/flux/blob/development/Documentation/ViewHelpers/Form/Data.rst This example shows how to prevent TYPO3FluidFluidCoreViewHelperException when loading data from potentially disabled or deleted pages. It uses an f:if condition with f:uri.page to check page accessibility before attempting to load data using flux:form.data. ```fluid ... ``` -------------------------------- ### Core Hack: Modify TemplateParser.php for Flux Upgrade Source: https://github.com/fluidtypo3/flux/wiki/GIT-Master-&-6.1---6.0 This snippet details a one-line code change in the TYPO3 core's TemplateParser.php file. This hack is considered safe as the fix will be backported to TYPO3 6.0 and 6.1 in future releases. It requires direct access to the TYPO3 core files. ```php https://review.typo3.org/#/c/25814/9/typo3/sysext/fluid/Classes/Core/Parser/TemplateParser.php ``` -------------------------------- ### Flux Data Transformation Examples Source: https://context7.com/fluidtypo3/flux/llms.txt Demonstrates Flux's capability to automatically transform field values to specific data types using the 'transform' attribute within Flux form definitions. This includes transformations to boolean, integer, float, array, DateTime, File objects, and domain models. ```xml ```