Download the PHP package wuhhh/template-genie without Composer
On this page you can find all versions of the php package wuhhh/template-genie. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wuhhh/template-genie
More information about wuhhh/template-genie
Files in wuhhh/template-genie
Package template-genie
Short Description A Craft CMS plugin for scaffolding Twig templates based on CMS setup with field-aware variable definitions
License proprietary
Informations about the package template-genie
Template Genie Plugin for Craft CMS
A Craft CMS plugin that scaffolds Twig templates and partials based on your CMS structure, with intelligent field-aware variable definitions and sensible defaults.
What It Does
Template Genie analyzes your Craft CMS setup and generates:
- Section templates - Entry point templates that delegate rendering to partials
- Entry type partials - Field-aware templates with proper variable assignments
- Matrix/Content Block partials - Nested element templates for complex fields
- Smart HTML output - Optional semantic HTML rendering for rapid prototyping
The plugin understands all 29 native Craft CMS field types (100% coverage) and generates appropriate variable assignments, null coalescing patterns, and helpful context comments.
Key Features
- Complete field support - All native Craft 5 fields including Content Block
- Smart variable assignment - Automatically handles
.one()vs.all()based on relation limits - Context-aware comments - Field constraints, options, and limits included inline
- Layout integration - Apply Twig layouts during generation
- Interactive mode - User-friendly prompts for configuration
- Selective generation - Generate templates only, partials only, or specific sections
- Safe overwrite handling - Prompts before overwriting existing files
Installation
This plugin is available via Packagist:
Basic Usage
Interactive Mode (Recommended)
Simply run the command with no options for an interactive setup wizard:
The interactive mode will guide you through:
- Section selection
- Template vs partial generation
- Layout file selection
- Output style preferences
- Overwrite behavior
Command Line Options
Generate templates and partials for specific sections:
Advanced Options
Output Styles
Template Genie supports different output styles:
Minimal (Default)
Generates only variable assignments with context comments:
Full
Includes semantic HTML rendering for rapid prototyping:
How It Works
Section Templates
For sections with defined template paths, Template Genie generates entry point templates that delegate to partials:
Entry Type Partials
Partials are generated at _partials/entry/{entryTypeHandle}.twig with field-aware variables:
Smart Field Handling
The plugin detects field configuration and generates appropriate patterns:
Single vs Multi Relations:
Field Constraints:
Field Options:
Field Support
Template Genie supports all 29 native Craft CMS field types with intelligent handling:
- Addresses, Assets, Button Group, Categories, Checkboxes
- Color, Content Block, Country, Date, Dropdown
- Email, Entries, Icon, JSON, Lightswitch
- Link, Matrix, Money, Multi-select, Number
- Plain Text, Radio Buttons, Range, Table, Tags
- Time, Users
Each field type receives appropriate:
- Variable assignment pattern
- Null coalescing behavior
- Context comments with constraints
- Optional HTML rendering
Tips
- Use
.render()- Generated partials work automatically with Craft's render delegation - Matrix fields - Matrix block partials are auto-generated, use
{{ block.render() }} - Layouts - Apply layouts during generation to wrap templates in your site structure
- Force mode - Use
-fflag in CI/CD pipelines to skip prompts - Sections only - Skip sections without template paths (valid for Channel sections)
Requirements
- Craft CMS ^5.0.0
- PHP ^8.2
License
Proprietary - Commercial plugin for Craft CMS
Support
- Documentation: https://github.com/wuhhh/template-genie
- Issues: https://github.com/wuhhh/template-genie/issues