Building Themes for Aikeedo v3.x
Creating a custom theme for Aikeedo allows you to personalize the look and feel of your platform. This guide covers the modern approach using the Aikeedo Theme Starter Kit - a comprehensive development environment that streamlines theme creation.This guide is for Aikeedo v3.x. We strongly recommend using the themes-starter kit for new theme development as it provides a modern build system and best practices.
Modern Theme Development with Starter Kit
The Aikeedo Theme Starter Kit provides a modern development environment with:- Vite.js for fast asset building and hot module replacement
- Alpine.js for lightweight JavaScript interactivity
- Tailwind CSS for utility-first styling
- Twig for PHP templating
- Gettext for internationalization
- PHP Composer package structure
Theme Development Options
You have several options for theme development:- Build a new theme from scratch using the themes-starter kit
- Customize the default theme for simple modifications
- Customize marketplace themes for advanced modifications
- Rebuild themes from source for complex customizations
Choosing the Right Approach
- Simple Changes
- Complex Changes
- New Theme
Use: Quick customization (Option 2 or 3)Best for:
- Changing colors, fonts, or basic styling
- Modifying text content
- Simple layout adjustments
- Adding basic HTML elements
- Manual asset copying required
- No hot reloading
- Limited to existing template structure
Option 1: Building a New Theme
Clone the Starter Repository
Start by cloning the themes-starter repository:Configure Your Theme Package
Edit/static/composer.json with your theme details:
Important: Replace
YourVendor\\ThemeName with your actual namespace. The namespace in autoload.psr-4 must match your entry-class namespace.Set Up Environment
Create your local environment file:.env.local with your paths:
Critical: The final path segments (
your-vendor/your-theme-name) MUST match your composer.json package name!Install Dependencies
Install npm packages:Start Development Server
- Start Vite dev server on port 5174
- Watch for file changes
- Copy static files to
BUILD_DIR - Extract translations automatically
Register Theme with Aikeedo
In your Aikeedo installation directory:Configure Aikeedo
Add or update these settings in your Aikeedo’s.env file:
Verify Installation
Activate Your Theme
1
Log into Admin Panel
Access your Aikeedo admin panel
2
Navigate to Themes
Go to the Themes section in the admin panel
3
Find Your Theme
Locate your theme in the list of available themes
4
Activate Theme
Click “Publish” to activate your theme
Your theme is now active and visible to users!
Option 2: Customizing the Default Theme
For simple modifications to the default theme, you can make direct changes without rebuilding from source.This approach is suitable for basic customizations. For complex changes, consider rebuilding from source (Option 4).
Quick Customization Guide
For detailed step-by-step instructions on customizing the default theme, including:- Duplicating the default theme
- Updating composer configuration
- Copying public assets
- Activating your custom theme
- Making changes and managing cache
Landing Page Customization
Complete step-by-step guide for customizing the default theme with detailed instructions for duplicating, configuring, and modifying themes.
Option 3: Customizing Marketplace Themes
For themes purchased from the Aikeedo marketplace, follow the same process as customizing the default theme, but start with your purchased theme instead.Always work on a copy of the theme to prevent losing changes during updates.
Quick Customization Guide
Follow the same steps as customizing the default theme, but replace the default theme with your purchased theme.Landing Page Customization
Complete step-by-step guide for customizing themes with detailed instructions for duplicating, configuring, and modifying themes.
Option 4: Rebuilding Themes from Source
For complex customizations, rebuild the theme from source using the same process as building a new theme.Rebuilding the Default Theme
1
Clone the Default Theme Repository
2
Configure Your Theme
Follow the same configuration steps as building a new theme, but update the package name to avoid conflicts:
3
Set Up Development Environment
Follow the same environment setup as building a new theme, but point to your custom theme directory.
4
Make Your Customizations
Edit the source files in the
src/ and static/ directories as needed.5
Build and Deploy
Project Structure
The themes-starter kit provides a well-organized structure:Development Features
Hot Module Replacement
The starter kit provides instant development feedback:- Instant CSS updates via Tailwind CSS
- Alpine.js component reloading for JavaScript changes
- Full page reload for Twig template changes
- Automatic static file copying to your Aikeedo installation
Custom Elements
The starter kit includes pre-built custom elements:Twig Templates
Use the modern Twig templating system:Internationalization
The starter kit includes automatic translation extraction:- Automatic string extraction to PO files
- Multiple language support with Gettext
- Translation file watching during development
- Uses PHP’s Gettext for translations
Available Commands
| Command | Purpose |
|---|---|
npm run dev | Start Vite development server |
npm run build | Build production assets |
npm run serve | Preview production build |
npm run locale | Extract translatable strings |
npm run pack | Create installable theme package |
npm run release | Create distribution package |
Theme Objects
Aikeedo provides several objects for use in Twig templates:- theme: Theme metadata and configuration
- option: Site settings and options
- user: Current user information
- environment: Environment variables and settings
Best Practices
- Use the Starter Kit: Always start with the themes-starter for new themes
- Responsive Design: Ensure your theme looks good on all device sizes using Tailwind CSS
- Accessibility: Follow WCAG guidelines to make your theme usable for everyone
- Performance:
- Leverage Vite’s built-in optimization
- Use Tailwind’s utility classes for efficient CSS
- Implement lazy loading for images
- Take advantage of Alpine.js’s lightweight nature
- Version Control: Use Git to track changes and maintain version history
- Documentation: Document your theme’s features and customization options
- Testing: Test across different browsers and devices
Common Setup Issues
Assets Not Loading
If theme assets aren’t loading:- Verify
THEME_ASSETS_SERVERin Aikeedo’s.env - Ensure Vite server is running on port 5174
- Check proxy settings in
vite.config.mjs
Template Changes Not Reflecting
- Clear Aikeedo’s cache
- Check
BUILD_DIRpath is correct - Verify file permissions
Build Problems
- Verify all paths in
.env.local - Check write permissions on
BUILD_DIR - Review Vite build output for errors
Related Guides
- Landing Page Customization - Basic customization guide for the default theme
- Theme Objects - Available objects for templates
- Localization - Add multilingual support
- Themes Starter Repository - Modern development starter kit
- Default Theme Repository - Source code for the default theme
Need Help?
If you need assistance with Aikeedo:Professional Support
Get expert help from our team with a paid support subscription
Troubleshooting Guide
Check common issues and solutions