This extension uses the "friendsoftypo3/content-blocks" extension to dynamically generate its TCA (Table Configuration Array) and SQL through Content Blocks (RecordTypes). Despite including 4 models, the only manually written TCA in this extension is the registration of a plugin in tt_content.php. All necessary SQL is automatically generated by Content Blocks.
Content Blocks provides the code basis for generating all the TCA and SQL. By using Content Blocks, you use an existing, robust, community-driven tool that simplifies TYPO3 development.
- Out-of-the-Box Functionality: Content Blocks already includes CLI commands to generate new content blocks, saving you time and effort.
- Future Enhancements: As Content Blocks evolves, with this approach you directly benefit from new features, such as additional CLI commands or even a GUI-based interface for managing content blocks. This ensures your extension remains up-to-date and aligned with the latest TYPO3 advancements.
This collaborative approach not only reduces redundancy but also ensures easier maintainability and development.
Consider this extension a proof of concept for modern TYPO3 development practices.
This approach offers several advantages over traditional Extbase extensions:
- Automated SQL Generation: SQL tables are dynamically created based on your Content Blocks configuration, eliminating the need for manual SQL scripting.
- Automated TCA Generation: The TCA is automatically generated, reducing the risk of errors and saving development time.
- Simplified Property Management: Adding or modifying properties requires changes to only 2 files (
config.yamlandModel.php), streamlining development. - Reduced Boilerplate Code: By using public properties in the model (with property hooks in PHP 8.4), the need for repetitive getter and setter methods is minimized.
- Increased Robustness: With less custom code, there are fewer opportunities for bugs, making the extension more stable and reliable.
- Easier TYPO3 Upgrades: Content Blocks handle much of the heavy lifting, ensuring smoother transitions during TYPO3 updates.
- Dependency on External Library: Currently, "friendsoftypo3/content-blocks" is not part of the TYPO3 core. However, this is expected to change with the release of TYPO3 14.
I’d love to hear your thoughts on this new approach! Do you think it’s a good idea? How could it be improved? I'd love to hear your opinions, suggestions and constructive criticism. Feel free to share your thoughts by opening an issue or reaching out directly.