Download the PHP package pixelcoda/typo3-storybook-fluid-api without Composer
On this page you can find all versions of the php package pixelcoda/typo3-storybook-fluid-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pixelcoda/typo3-storybook-fluid-api
More information about pixelcoda/typo3-storybook-fluid-api
Files in pixelcoda/typo3-storybook-fluid-api
Package typo3-storybook-fluid-api
Short Description TYPO3 extension that provides an API to render TYPO3 Fluid templates and partials through HTTP/HTTPS requests.
License MIT
Informations about the package typo3-storybook-fluid-api
TYPO3 Storybook Fluid API Extension [Backend]
This TYPO3 extension provides an API to render TYPO3 Fluid templates and partials through HTTP/HTTPS requests. Compatible with TYPO3 12.
Inspired by the Storybook TYPO3 Fluid plugin, this extension extends the functionality to facilitate rendering and testing TYPO3 Fluid templates in external tools such as Storybook or other frontend environments.
Looking for the frontend integration? Check out the TYPO3 Fluid Storybook Frontend.
Features
- Render Fluid Templates via API: Seamlessly render TYPO3 Fluid templates and partials through JSON-based HTTP requests.
- Rapid Frontend Development: Connect TYPO3 templates with frontend tools like Storybook to test and preview components outside the TYPO3 environment.
- JSON-Based Communication: Simplified integration with frontend applications using JSON request and response formats.
- TYPO3 v12 Compatible: Fully compatible with TYPO3 12, leveraging the latest TYPO3 features.
See her Frontend implementation: TYPO3 Fluid Storybook Frontend.
Requirements
- A working TYPO3 instance with TYPO3 v12 installed.
- TYPO3 site configured and accessible.
Installation
Install the extension via Composer:
Clear the TYPO3 cache after installation to ensure the extension is loaded:
Usage
API Endpoint
The default API endpoint for rendering templates is:
This endpoint accepts JSON payloads to specify templates, partials, and additional arguments.
Request Structure
You can send a POST request to the endpoint with the following JSON payload:
Response Structure
Success Response
Error Response
Example Workflow with Storybook
This example demonstrates how to integrate a TYPO3 Fluid template (PersonsListTeaserFluid
) into Storybook for rendering and interactive customization.
Fluid Template Import
The Fluid renderer is imported using the FluidTemplate
function:
Define the Fluid Template Path
Specify the path to the Fluid template:
Default Arguments
Define default values for the template variables:
Storybook Configuration
The PersonsListTeaserFluid
story is exported for use in Storybook:
Define the Template
Create a template function that renders the Fluid template:
Export the Story
The story is exported and connected to the default arguments:
Benefits
- Interactive Testing: Test Fluid templates dynamically in Storybook.
- Decoupled Development: Render TYPO3 Fluid templates without a fully loaded TYPO3 environment.
- Modern Workflow: Enable modern component-based frontend development.
Contributing
We welcome contributions to improve this extension. If you encounter bugs or have feature suggestions, feel free to open an issue or submit a pull request on GitHub.
License
This extension is licensed under the MIT License.
Credits
Inspired by storybook-typo3fluid. Developed by Casian Blanaru / PixelCoda.