### Post-Creation Cache Flush and Setup Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/Commands/Make/Index.html Commands to execute after creating a content block to update database tables/fields and extension setup. ```bash vendor/bin/typo3 cache:flush -g system vendor/bin/typo3 extension:setup --extension=my_sitepackage ``` -------------------------------- ### Install Content Blocks Extension Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/Migrations/Mask/Index.html If Content Blocks is not yet installed, install it using Composer. This is a prerequisite for the migration. ```bash composer req friendsoftypo3/content-blocks ``` -------------------------------- ### Install Mask to Content Blocks Migration Extension Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/Migrations/Mask/Index.html Install the migration extension using Composer. This is the first step for automatic migration. ```bash composer req nhovratov/mask-to-content-blocks ``` -------------------------------- ### Select Single Minimal Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Select/Index.html Demonstrates a basic configuration for a single select dropdown. ```yaml name: example/select fields: - identifier: select type: Select renderType: selectSingle items: - label: 'The first' value: one - label: 'The second' value: two ``` -------------------------------- ### Example Lint Command Output Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/Commands/Lint/Index.html This is an example of the output you might see when running the content-blocks:lint command, highlighting configuration errors found. ```text +-----------------------------+---------------------------------------------------+ | Path | example/card-group | EXT:content_blocks_examples | +-----------------------------+---------------------------------------------------+ | /fields/3/fields/3/fields/0 | Additional object properties are not allowed: max | +-----------------------------+---------------------------------------------------+ [ERROR] Found 1 errors ``` -------------------------------- ### Minimal Color Field Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Color/Index.html A basic example demonstrating the minimal configuration for a Color field type. ```yaml name: example/color fields: - identifier: color type: Color ``` -------------------------------- ### Minimal Tab Field Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Tab/Index.html This is a basic example demonstrating how to implement a Tab field. It shows a simple text field, followed by a tab, and then another textarea field. ```yaml name: example/tab fields: - identifier: text type: Text - identifier: tab_1 type: Tab - identifier: text2 type: Textarea ``` -------------------------------- ### Make Command on Non-Composer Installations Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/Commands/Make/Index.html Specifies the command path for TYPO3 installations not managed by Composer. ```bash typo3/sysext/core/bin/typo3 make:content-block ``` -------------------------------- ### Get Help for Make Content Block Command Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/Commands/Make/Index.html Displays all available options for the `make:content-block` command. ```bash vendor/bin/typo3 make:content-block --help ``` -------------------------------- ### Example Output of List Command Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/_sources/Commands/List/Index.rst.txt This is an example of the tabular output generated by the `content-blocks:list` command, showing details like vendor, name, extension, content-type, and table. ```bash +-----------+-------------------+-------------------------+-----------------+-----------------------------+ | vendor | name | extension | content-type | table | +-----------+-------------------+-------------------------+-----------------+-----------------------------+ | example | tabs | content_blocks_examples | Content Element | tt_content | | example | accordion | content_blocks_examples | Content Element | tt_content | | example | card-group | content_blocks_examples | Content Element | tt_content | | example | cta | content_blocks_examples | Content Element | tt_content | | example | icon-group | content_blocks_examples | Content Element | tt_content | | example | imageslider | content_blocks_examples | Content Element | tt_content | | example | example-page-type | content_blocks_examples | Page Type | pages | | hov | record1 | content_blocks_examples | Record Type | tx_hov_domain_model_record1 | | hov | record2 | content_blocks_examples | Record Type | tx_hov_domain_model_record1 | | hov | notype | content_blocks_examples | Record Type | tx_hov_domain_model_notype | +-----------+-------------------+-------------------------+-----------------+-----------------------------+ ``` -------------------------------- ### List All Content Blocks Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/Commands/List/Index.html Execute this command to get an overview of all available Content Blocks. ```bash vendor/bin/typo3 content-blocks:list ``` -------------------------------- ### Interactive Content Block Creation Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/Commands/Make/Index.html Illustrates the step-by-step prompts and user inputs during an interactive content block creation process. ```bash Choose the content type of your content block [Content Element]: [content-element] Content Element [page-type ] Page Type [record-type ] Record Type > content-element Enter your vendor name: > my-vendor Enter your content block name: > my-content-block-name Choose an extension in which the content block should be stored: [sitepackage] Test Package for content blocks > sitepackage ``` -------------------------------- ### Minimal Radio Field Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Radio/Index.html A basic example demonstrating the 'Radio' field type with essential 'items' configuration. ```yaml name: example/radio fields: - identifier: radioboxes type: Radio items: - label: 'First option' value: 0 - label: 'Second option' value: 1 ``` -------------------------------- ### Configure Full Prefixing Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/API/Prefixing/Index.html This example shows how to enable prefixing globally and set the prefix type to 'full', which uses the entire vendor/element name as the prefix. ```yaml name: my-vendor/my-element prefixFields: true prefixType: full ``` -------------------------------- ### Example labels.xlf Output Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/Commands/LanguageGenerate/Index.html This is an example of the XML output generated by the labels.xlf file. It shows the structure of trans-units for different content block fields. ```xml
My demo title This is just a demo/demo Existing field override My Slug My Slug Description my_collection text my_collection text external_table external_table_2 related_content My translation ``` -------------------------------- ### Minimal Linebreak Field Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Linebreak/Index.html Demonstrates the basic usage of a Linebreak field within a Palette. This example shows how to insert a manual linebreak between a Number and a Text field. ```yaml name: example/linebreak fields: - identifier: palette_1 type: Palette fields: - identifier: number type: Number - type: Linebreak - identifier: text type: Text ``` -------------------------------- ### Section Field Type Configuration Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/FlexForm/Section/Index.html This example demonstrates how to configure a Section field type with multiple containers and nested fields. It shows the structure for defining identifiers, labels, and the fields within each container. ```yaml - identifier: pi_flexform useExistingField: true fields: - identifier: section1 type: Section label: Section 1 container: - identifier: container1 label: Container 1 fields: - identifier: container_field type: Text label: Container field - identifier: container2 label: Container 2 fields: - identifier: container_field2 type: Textarea label: Container field 2 ``` -------------------------------- ### Minimal FlexForm Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/FlexForm/Index.html Demonstrates the basic structure of a FlexForm field, including a text and a checkbox input. ```yaml name: example/flex fields: - identifier: my_flexform type: FlexForm fields: - identifier: header type: Text - identifier: check type: Checkbox ``` -------------------------------- ### Minimal Palette Field Configuration Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Palette/Index.html A basic example demonstrating the configuration of a Palette field, including its identifier, label, description, and nested fields. ```yaml name: example/palette fields: - identifier: palette_1 type: Palette label: Palette 1 description: My palette description fields: - identifier: number type: Number - identifier: text type: Text ``` -------------------------------- ### FlexForm with Sheets Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/FlexForm/Index.html Illustrates how to organize FlexForm fields into multiple sheets, creating a tabbed interface for different sets of inputs. ```yaml name: example/flex fields: - identifier: my_flexform type: FlexForm fields: - identifier: sheet1 type: Sheet label: Sheet 1 description: Description for Sheet 1 linkTitle: Link title for Sheet 1 fields: - identifier: header type: Text - identifier: check type: Checkbox - identifier: sheet2 type: Sheet label: Sheet 2 fields: - identifier: link type: Link - identifier: radio type: Radio default: 0 items: - label: Option 1 value: 0 - label: Option2 2 value: 1 ``` -------------------------------- ### Example Extbase Controller Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/Guides/CreateExtbasePlugin/Index.html A basic Extbase controller action that retrieves data from the current content object and assigns it to the Fluid view for rendering. ```php request->getAttribute('currentContentObject'); $dataFromTypoScript = $contentObject->data; $this->view->assign('data', $dataFromTypoScript); return $this->htmlResponse(); } } ``` -------------------------------- ### Configure Vendor Prefixing Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/API/Prefixing/Index.html This example illustrates how to enable prefixing globally and set the prefix type to 'vendor', using only the vendor part of the name as the prefix. ```yaml name: my-vendor/my-element prefixFields: true prefixType: vendor ``` -------------------------------- ### Select Tree Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Select/Index.html Configures a select field to render as a tree, specifying the foreign table and tree configuration. ```yaml name: example/select fields: - identifier: select_tree type: Select renderType: selectTree size: 5 foreign_table: 'pages' foreign_table_where: 'ORDER BY pages.uid' treeConfig: parentField: pid ``` -------------------------------- ### Select Multiple Side-by-Side Minimal Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Select/Index.html Demonstrates a basic configuration for a multiple select dropdown using the side-by-side render type. ```yaml name: example/select fields: - identifier: select_side_by_side type: Select renderType: selectMultipleSideBySide items: - label: 'The first' value: one - label: 'The second' value: two ``` -------------------------------- ### Color Value Picker Items Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/_sources/YamlReference/FieldTypes/Color/Index.rst.txt Example of defining static color items for the value picker in a Color field type. Each item has a label and a corresponding color value. ```yaml valuePicker: items: - label: 'Red' value: #FF0000 - label: 'Green' value: #008000 - label: 'Blue' value: #0000FF ``` -------------------------------- ### Configure Vendor Prefixing with Static Prefix Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/API/Prefixing/Index.html This example shows how to use the 'vendor' prefix type with a custom static prefix defined by 'vendorPrefix'. ```yaml name: my-vendor/my-element prefixFields: true prefixType: vendor vendorPrefix: tx_foo ``` -------------------------------- ### Example Content Block Configuration (config.yaml) Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/Introduction/Index.html This YAML file defines a single Content Type, specifying its name and fields. It serves as the basis for a Content Block definition. ```yaml name: vendor/content-block-name fields: - identifier: my_text_field type: Text ``` -------------------------------- ### Install Content Blocks via Composer Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/Installation/Index.html Use this Composer command to add the Content Blocks extension to your TYPO3 project. ```bash composer require friendsoftypo3/content-blocks ``` -------------------------------- ### Set Starting Points for Category Tree Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/singlehtml/Index.html The 'treeConfig.startingPoints' option allows specifying one or more root category UIDs from which categories should be taken. ```yaml treeConfig.startingPoints: "1,2,3" ``` -------------------------------- ### Create Content Block Skeleton Interactively Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/Commands/Make/Index.html Initiates an interactive process to guide the user through creating a content block skeleton by omitting required options. ```bash vendor/bin/typo3 make:content-block ``` -------------------------------- ### Select Single Advanced Example with Foreign Table Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Select/Index.html Configures a single select dropdown with a default value and fetches items from a foreign table with a specific where clause. ```yaml name: example/select fields: - identifier: select type: Select renderType: selectSingle default: 'one' items: - label: 'The first' value: one - label: 'The second' value: two - label: 'The third' value: three foreign_table: pages foreign_table_where: 'AND {#pages}.{#pid} = 123 ORDER BY uid' ``` -------------------------------- ### Include Extension Partials for a Specific Content Block Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/_sources/Guides/SharedPartials/Index.rst.txt Define 'partialRootPaths' for a specific content block type in your TypoScript setup to include custom partials. This example targets 'tt_content.myvendor_mycontentblockname'. ```typoscript tt_content.myvendor_mycontentblockname { partialRootPaths { 100 = EXT:my_site_package/Resources/Private/Partials/ContentElements/ } } ``` -------------------------------- ### Minimal Collection Field Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Collection/Index.html A basic example of a Collection field type, demonstrating its structure with a nested Text field. ```yaml name: example/collection fields: - identifier: collection type: Collection labelField: text fields: - identifier: text type: Text ``` -------------------------------- ### Advanced Folder Field Configuration with Entry Points and Minimum Items Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Folder/Index.html This example demonstrates an advanced Folder field configuration, specifying entry points for the element browser and a minimum of one item. ```yaml name: example/folder fields: - identifier: folder type: Folder elementBrowserEntryPoints: _default: '1:/styleguide/' minitems: 1 ``` -------------------------------- ### File Field Configuration Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/_sources/YamlReference/FieldTypes/File/Index.rst.txt Shows a basic configuration for a File field type, specifying allowed file types and defining crop variants with specific aspect ratios and focus areas. ```yaml type: File allowed: common-image-types cropVariants: desktop: title: Desktop allowedAspectRatios: portrait: title: Portrait value: 0.75 landscape: title: Landscape value: 4 / 3 focusArea: x: 0.3 y: 0.3 width: 0.4 height: 0.4 coverAreas: - x: 0.1 y: 0.8 width: 0.8 height: 0.1 tablet: title: Tablet allowedAspectRatios: square: title: Square value: 0.75 smartphone: title: Smartphone allowedAspectRatios: landscape: title: Landscape value: 4 / 3 ``` -------------------------------- ### Backend Preview Before Update Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/ChangeLog/1.1/Index.html Illustrates the old method for backend previews of Content Elements before the required 'Preview' layout. ```html
My content
``` -------------------------------- ### Advanced Link Field Configuration with Options Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Link/Index.html This example demonstrates an advanced configuration for a Link field, including autocomplete, a default URL, allowed link types, making the field required, and defining custom value picker items. ```yaml name: example/link fields: - identifier: url type: Link autocomplete: true default: 'https://typo3.org' allowedTypes: - page - url - file required: true valuePicker: items: - label: 'TYPO3 CMS' value: 'https://www.typo3.org' - label: 'TYPO3 GmbH' value: 'https://www.typo3.com' ``` -------------------------------- ### Minimal Language Field Type Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Language/Index.html This is a minimal example demonstrating how to define a field with the 'Language' type in a TYPO3 content block configuration. It shows the basic structure required to include a language selection element. ```yaml name: example/language fields: - identifier: language type: Language ``` -------------------------------- ### Disable Prefixing Globally Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/API/Prefixing/Index.html This example demonstrates how to disable the prefixing mechanism entirely for all fields. ```yaml name: my-vendor/my-element prefixFields: false ``` -------------------------------- ### Minimal Number Field Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Number/Index.html A basic configuration for a Number field, specifying its identifier and type. ```yaml name: example/number fields: - identifier: number type: Number ``` -------------------------------- ### Configure Dynamic Page Creation Wizard Steps Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/ChangeLog/2.2/Index.html Dynamically configure the steps and fields displayed in the page creation wizard using `wizardSteps`. Define titles, fields, and their order. ```yaml wizardSteps: setup: title: Setup fields: - title - slug - nav_title - hidden - nav_hide special: title: Special fields: - additional_field after: - setup ``` -------------------------------- ### Checkbox Field Type - Items Translation Keys Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/_sources/YamlReference/FieldTypes/Checkbox/Index.rst.txt Example of XLF translation keys for checkbox item labels. ```xml Label for first Checkbox item Label for second Checkbox item Label for nth Checkbox item ``` -------------------------------- ### Backend Preview After Update Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/ChangeLog/1.1/Index.html Shows the updated backend preview structure using the 'Preview' layout and a 'Content' section for assets and content. ```html
My content
``` -------------------------------- ### Directory Structure for Custom Icons Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/_sources/API/PageTypes/Index.rst.txt Illustrates the directory structure for placing custom icons for Page Type states, such as 'hide in menu' and 'is site root'. ```none ├── assets │ │── icon.svg │ │── icon-hide-in-menu.svg │ └── icon-root.svg └── config.yaml ``` -------------------------------- ### Select Single with Icons Example Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Select/Index.html Configures a single select dropdown where each item has an associated icon, useful for visual selection. ```yaml name: example/select fields: - identifier: select_icons type: Select renderType: selectSingle fieldWizard: selectIcons: disabled: false default: 'image-left' items: - label: 'Image beside text (left)' value: image-left icon: content-beside-text-img-left - label: 'Image beside text (right)' value: image-right icon: content-beside-text-img-right - label: 'Image above text (center)' value: image-above icon: content-beside-text-img-above-cent ``` -------------------------------- ### Disable Prefixing for a Specific Field Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/API/Prefixing/Index.html This example demonstrates how to enable global prefixing but disable it for a specific field identified by 'my_field'. ```yaml name: my-vendor/my-element prefixFields: true prefixType: full fields: - identifier: my_field type: Text prefixField: false ``` -------------------------------- ### Define Default Options for Make Command Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/ChangeLog/1.1/Index.html Configure default values for `vendor`, `extension`, `content-type`, and `skeleton-path` in a `content-blocks.yaml` file to streamline the `make:content-block` command. ```yaml vendor: nh extension: content_blocks_examples content-type: record-type skeleton-path: folder1/content-block-skeletons ``` -------------------------------- ### Disable Workspace Awareness Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/_sources/YamlReference/ContentTypes/RecordTypes/Index.rst.txt Disables the creation of workspace-related fields (e.g., t3ver_oid, t3ver_wsid). This functionality depends on the installation of EXT:workspaces. ```yaml workspaceAware: false ``` -------------------------------- ### Minimal Checkbox Field Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Checkbox/Index.html This is a basic example of how to define a single checkbox field. It sets the field identifier and specifies the type as Checkbox. ```yaml name: example/checkbox fields: - identifier: checkbox type: Checkbox ``` -------------------------------- ### Adding a Content Block as a Site Set Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/API/SiteSets/Index.html Example of how to define a Content Block as a dependency within a site's configuration YAML file. This allows for granular control over which Content Blocks are required for a specific site. ```yaml name: my-vendor/my-set label: My Set dependencies: - example/card-group - example/cta ``` -------------------------------- ### Advanced Password Field with Options Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Password/Index.html This example demonstrates an advanced configuration for a Password field, including requirements, disabling hashing, setting a password policy, and enabling a password generator. ```yaml name: example/password fields: - identifier: password type: Password required: true hashed: false passwordPolicy: 'default' fieldControl: passwordGenerator: renderType: passwordGenerator ``` -------------------------------- ### Create Content Block Skeleton in One Line Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/Commands/Make/Index.html Generates a content block skeleton with specified parameters in a single command. ```bash vendor/bin/typo3 make:content-block --content-type="content-element" --vendor="my-vendor" --name="my-name" --title="My shiny new Content Element" --extension="my_sitepackage" ``` -------------------------------- ### Get LLL Path for Labels Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/Templating/Index.html Use the LanguagePath ViewHelper to retrieve the LLL path for the labels.xlf file of the current Content Block. ```fluid ``` -------------------------------- ### Configure Fields for Collection Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/_sources/YamlReference/FieldTypes/Collection/Index.rst.txt Define the child fields that make up the repeatable items within a collection. This example includes text and file fields. ```yaml fields: - identifier: text type: Text - identifier: image type: File ``` -------------------------------- ### Advanced Text Field Configuration with Options Source: https://docs.typo3.org/p/friendsoftypo3/content-blocks/main/en-us/YamlReference/FieldTypes/Text/Index.html This example demonstrates an advanced Text field configuration, including default value, minimum and maximum length, and marking the field as required. This is useful for enforcing specific input constraints and ensuring data integrity. ```yaml name: example/text fields: - identifier: text type: Text default: 'Default value' min: 4 max: 15 required: true ```