From 3eff0357840753d389dc9752f03d235e2d06e106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Uzna=C5=84ski?= Date: Mon, 30 Oct 2023 10:43:40 +0100 Subject: [PATCH] Update readme --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index 99c9237f..4862c69f 100644 --- a/README.md +++ b/README.md @@ -209,6 +209,37 @@ Used for proecessing flexforms. ### RootSitesProcessor Render your all headless sites configuration for your frontend application. +## Configuration +### Available Settings: +- **Not Enabled**: Headless mode is deactivated. +- **Mixed Mode**: Fluid and headless operate concurrently. +- **Fully Headless Mode**: Headless mode is fully activated. + +To set up headless mode, utilize the site configuration flag as shown below: + +```yaml +'headless': 0|1|2 +``` + +While the legacy flag (true|false) is still recognized, transitioning to the integer notation is recommended. + +### Options: +- **0** (formerly: false) = headless mode is deactivated for the site within the TYPO3 instance. +- **1** (formerly: true) = headless mode is fully activated for the site within the TYPO3 instance. +- **2** = mixed mode headless is activated (both fluid & json API are accessible within a single site in the TYPO3 instance). + +Options **0** (formerly: false) or **1** (formerly: true) inform the extension to either fully disable or enable headless mode for a particular site. + +### To Enable Mixed Mode: +For a chosen site in TYPO3, follow these steps: +- In the typoscript template for the site, load the "Headless - Mixed mode JSON response" setup file instead of the default headless one. +- Set `headless` flag to a value of `2` in the site configuration file or configure the flag via editor in the Site's management backend. + +The mixed mode flag (value of `2`) instructs the EXT:headless extension to additionally check for the `Accept` header with a value of `application/json` when processing requests to the particular site in the TYPO3 instance. + +- In cases where a request lacks the `Accept` header or `Accept` has a different value than `application/json`, TYPO3 will respond with HTML content (standard TYPO3's response). +- In cases where a request's header `Accept` matches the value of `application/json`, TYPO3 will respond with a JSON response. + ## Development Development for this extension is happening as part of the TYPO3 PWA initiative, see https://typo3.org/community/teams/typo3-development/initiatives/pwa/ If you have any questions, join #initiative-headless-pwa Slack channel.