Creating Themes
Learn how to create a new theme for PteroCA using the CLI command.
Create Theme via CLI
The fastest way to create a new theme is using the CLI command.
Create Theme Command
docker exec pteroca_web_dev php bin/console pteroca:dev:make-themeThis command is interactive and will prompt you for:
Theme name (kebab-case identifier)
Display name (human-readable)
Author name
Author email
Theme description
License (default: MIT)
What the Command Does
Copies default theme to
themes/{your-theme-name}/Creates template.json with your provided metadata
Copies assets to
public/assets/theme/{your-theme-name}/Sets up directory structure with all necessary folders
Makes theme ready for customization
Command Output Example
Activating Your Theme
After creation, activate your theme using one of these methods:
Method 1: Via Admin Panel
Navigate to Settings → Appearance
Find Current theme of the panel (current_theme)
Change to your theme name
Click Save
Method 2: Via Database
First Steps After Creation
1. Verify Theme Installation
Check that your theme directory exists:
2. Test Theme Activation
Activate your theme via Admin Panel
Clear browser cache (Ctrl+Shift+R)
Refresh the panel
Verify no errors appear
3. Make Your First Customization
Edit the main stylesheet:
Add a simple customization:
Refresh the page to see changes.
No Visible Changes?
After switching from the default theme to your new one, you might not see any changes. This is normal!
Your theme is currently identical to the default theme. Start customizing to see the difference:
Modify CSS in
public/assets/theme/my-theme/css/Override templates in
themes/my-theme/Add custom JavaScript in
public/assets/theme/my-theme/js/
Creating a Theme from Scratch
If you prefer not to use the default theme as a base:
1. Create Directory Structure
2. Create template.json
3. Create Minimal Structure
You only need to override templates you want to customize. The rest will inherit from the default theme.
Theme Development Workflow
1. Development Environment
Work in development mode for better debugging:
This enables:
Symfony debug toolbar
Detailed error messages
Template paths in debug toolbar
No caching (changes appear immediately)
2. Make Changes
Edit templates, CSS, or JavaScript files.
3. Clear Cache (if needed)
Note: In dev mode, Twig templates don't require cache clearing.
4. Test Changes
Refresh browser (Ctrl+Shift+R for hard refresh)
Check console for errors (F12)
Verify changes appear correctly
5. Iterate
Repeat the cycle: make changes, test, refine.
Troubleshooting
Theme Not Appearing in Settings
Check:
template.jsonexists and is valid JSONTheme folder name matches
namefield in template.jsonAll required fields are present in template.json (name, description, author, version, license, pterocaVersion, phpVersion)
Restart the application or clear cache:
php bin/console cache:clear
Changes Not Appearing
Solutions:
Clear browser cache (Ctrl+Shift+R)
Clear Symfony cache:
php bin/console cache:clearVerify correct theme is activated
Check file paths are correct
Template Errors
Debug:
Enable dev mode (
APP_ENV=dev)Check error messages
Verify template syntax
Use Symfony debug toolbar to see which templates are loaded
Related Guides
Theme Structure - Understand file organization
Template.json - Configure metadata
Overriding Templates - Customize specific templates
Styling - Add custom CSS
Testing - Quality assurance
Last updated