Documentation

Architecture Review: Kirby CMS Project

Overview

This is a well-structured Kirby CMS project for a web development agency that follows modern content management patterns with a block-based architecture. The project uses Twig templating and implements a modular, component-based approach.

Architecture Strengths

  1. Block-Based Content Architecture Modular Design: The project implements a sophisticated block-based content system where pages are composed of reusable content blocks

Available Blocks:

  • block-text-image: Text content with accompanying images
  • block-contact-form: Contact forms with validation
  • block-team: Team member showcases
  • block-project-overview: Project portfolio displays
  • block-contact: Contact information blocks
  • block_full_page_slider: Hero/banner sliders Flexibility: This approach allows content editors to build complex pages without developer intervention
  1. Template Hierarchy & Organization Clean Separation: Templates are well-organized with clear separation of concerns Template Inheritance: Uses Twig's extends functionality with a base layout.twig Template Types:
  • home.twig: Specialized homepage template with full-window layout
  • default.twig: Standard page template with breadcrumbs
  • project.twig: Detailed project showcase with image galleries
  • error.twig: Error handling
  1. Component-Based Structure Partial Templates: Well-organized partials in /parts/:
  • header.html.twig
  • footer.html.twig
  • nav.html.twig
  • breadcrumb.html.twig Block Templates: Each block type has its own template for consistent rendering Asset Management: SVG assets are properly organized and included
  1. Multi-language Support Internationalization: Built-in support for multiple languages (German, English, Spanish based on content structure) Language Switching: Header includes language switcher functionality Localized Content: Translation functions implemented throughout templates

  2. Content Type Flexibility Page Types: Multiple blueprint types for different content:

  • default.yml: General pages with full block support
  • home.yml: Homepage with specialized blocks
  • project.yml: Project pages with metadata, tags, and media
  • person.yml: Team member profiles
  • partner.yml: Partner/client pages Field Reusability: Common field definitions in /fields/ for consistency

Technical Implementation

  1. Frontend Integration
  • Asset Pipeline: Proper asset fingerprinting for cache busting
  • Progressive Enhancement: Lazy loading for images
  • Performance: Optimized image delivery with multiple sizes/crops

Modern Features:

  • HTMX for dynamic form submissions
  • Swiper.js for image galleries
  • Google reCAPTCHA integration
  1. Form Handling
  • Robust Validation: Server-side form validation using Uniform
  • Email Integration: Symfony Mailer for email delivery
  • Error Handling: Comprehensive error messaging and validation
  • Security: CSRF protection and proper sanitization
  1. SEO & Analytics
  • Meta Management: Integrated meta tag management
  • Analytics: Multiple tracking systems (Matomo, Google Analytics)
  • Sitemap: Automated sitemap generation
  • Performance: Proper meta tags, favicons, and web app manifest

Areas for Improvement

  1. Blueprint Consistency
  • Incomplete Blocks: Some blocks like block-team.yml have minimal field definitions
  • Missing Documentation: Block blueprints could benefit from better field descriptions and help text
  • Validation: Some required fields lack proper validation rules
  1. Template Optimization
  • DRY Principle: Some repetitive code in block templates could be abstracted
  • Error Handling: More robust error handling for missing images/content
  • Accessibility: Could benefit from better ARIA labels and semantic markup
  1. Security Considerations
  • Input Sanitization: While forms are validated, ensure all user input is properly sanitized
  • File Upload Security: Image upload handling should include file type validation
  • Rate Limiting: Contact forms could benefit from rate limiting
  1. Performance Opportunities
  • Image Optimization: Consider WebP format support for better compression
  • Critical CSS: Inline critical CSS for above-the-fold content
  • Preloading: Strategic resource preloading for better performance

Architecture Score: 8.5/10

Strengths:

  • Excellent modular architecture
  • Clean separation of concerns
  • Scalable content management approach
  • Good internationalization support
  • Modern frontend integration

Recommendations:

  • Complete the block blueprint definitions with proper field validation
  • Implement consistent error handling across all templates
  • Add comprehensive field help text for content editors
  • Consider implementing a design system for consistent block styling
  • Add automated testing for form functionality
  • Implement proper logging and monitoring

Existing Architecture Details - Blueprint Definitions

Site-Level Blueprint (site.yml) Global Site Configuration:

  • Tabs Structure: Pages, Menu Configuration, Global Data, Meta
  • Menu Management: Main menu and footer menu with structured fields
  • Global Assets: Contact images management
  • Multi-language Support: Built-in language handling

Page Blueprints

  1. Home Page (home.yml)
  • Purpose: Landing page with specialized layout
  • Block Support: Only block_full_page_slider
  • Layout: 3/4 content area, 1/4 sidebar
  • Sidebar Features: Image management, subpage listing (default template only)
  1. Default Page (default.yml)
  • Purpose: Standard content pages with full block functionality
  • Block Support: 7 different block types
    • block-project-overview
    • block-text-image
    • block-service-overview (blueprint missing)
    • block-text
    • block-team
    • block-contact
    • block-contact-form
  • Layout: 3/4 content area, 1/4 sidebar
  • Sidebar Features: Image management, subpage listing (default, project, partner, person templates)
  1. Project Page (project.yml)
  • Purpose: Portfolio/project showcase pages
  • Content Fields:
    • Date (required)
    • Teaser title (required)
    • Teaser description
    • Teaser image (required, single)
    • Tags (predefined options: web-development, mobile-app, e-commerce, branding, ui-ux-design, backend, frontend, cms, api, responsive)
    • Project URL with link text
    • Multiple project images (required)
    • Design/concept partner reference
    • Rich text description (blocks)
    • Features structure (name + icon)
  • Layout: 3/4 content area, 1/4 sidebar
  • No Block Support: Uses traditional fields instead of blocks
  1. Person Page (person.yml)
  • Purpose: Team member profiles
  • Content Fields:
    • Teaser description
    • Teaser picture (optional)
    • Hidden picture (optional)
    • Quote text
    • Name
    • Email
  • Layout: 3/4 content area, 1/4 sidebar
  • No Block Support: Uses traditional fields
  1. Partner Page (partner.yml)
  • Purpose: Business partner/client profiles
  • Content Fields:
    • Name (required)
    • Partner URL (required)
  • Layout: 3/4 content area, 1/4 sidebar
  • No Block Support: Minimal field structure
  1. Error Page (error.yml)
  • Purpose: Error handling pages
  • Content Fields:
    • Title field
    • Large textarea
    • Error image (optional)
  • Simple Structure: Basic preset page
  1. Redirect Page (redirect.yml)
  • Purpose: URL redirection management
  • Content Fields:
    • Redirection URL (required)
  • Features: Status management, delete capability
  • No URL Option: URL disabled for this template

Block Blueprints

  1. Text Block (block-text.yml)
  • Fields: Rich text content (heading, text, list)
  • Styling: Margin bottom control (10, 20, 40, 60px options)
  1. Text with Image Block (block-text-image.yml)
  • Content Tab: Rich text description Link object (page/URL, text, target) Multiple images Anchor text
  • Style Tab: Image position (left/right)
  1. Team Block (block-team.yml)
  • Fields: Title only (minimal implementation)
  1. Contact Block (block-contact.yml)
  • Fields: Multiple images Introduction textarea Rich text description
  1. Contact Form Block (block-contact-form.yml)
  • Fields: Rich text description only (form handled by controller)
  1. Project Overview Block (block-project-overview.yml)
  • Fields: Title only (minimal implementation)
  1. Full Page Slider Block (block_full_page_slider.yml)
  • Structure Field: Slider items with:
    • Single image (required)
    • Textarea description (required)
    • Link object (page/URL, text, target)
    • Date range (from/to)
    • Anchor (required)
    • Icon color (white/blue)

Field Blueprints

  1. Image Field (image.yml)
  • Type: Files (image uploads)
  • Settings: Single image, required by default
  • Usage: Extended throughout other blueprints
  1. Image File Blueprint (image.yml)
  • Fields:
    • Alt text
    • Caption/prompt
    • Seed field
  • Accepted Formats: JPEG, PNG, SVG, WebP

Architecture Issues Identified

Missing Blueprints:

  • block-service-overview.yml - Referenced in default.yml but doesn't exist Incomplete Blueprints:
  • block-team.yml - Only has title field
  • block-project-overview.yml - Only has title field
  • block-contact-form.yml - Minimal content, form logic in controller Inconsistencies:
  • Block naming: Mixed conventions (block-text vs block_full_page_slider)
  • Field complexity: Varying levels of implementation across blocks
  • Tab usage: Some blocks use tabs, others don't

Recommended Architecture Improvements:

  • Complete missing blueprint: Create block-service-overview.yml
  • Standardize naming: Use consistent block naming convention
  • Enhance minimal blocks: Add proper fields to team and project overview blocks
  • Add validation: Implement proper field validation rules
  • Documentation: Add help text and descriptions to fields
  • Consistency: Standardize tab usage across complex blocks

📊 Architecture Report & Taxonomy Integration Plan (Kirby CMS)

1️⃣ Current Blueprint & Data Architecture Overview

Site-Level Blueprint (site.yml)

  • Purpose: Global site configuration and assets.
  • Tabs: Pages, Menu Configuration, Global Data, Meta.
  • Global Data: Contact images, multilingual setup.
  • Menus: Main menu & footer menu via structured fields.

Page Blueprints

Blueprint Purpose Features Notes
home.yml Landing page Specialized layout, block_full_page_slider only, sidebar image/subpage list Block-restricted
default.yml Standard content 7 blocks supported, sidebar image/subpage list Missing block-service-overview.yml
project.yml Portfolio showcase Date, teaser info, project images, tags (predefined), features (name+icon), partner ref, URL, rich description Uses traditional fields instead of blocks
person.yml Team member Teaser text & images, quote, contact info Minimal structure
partner.yml Business partner Name, URL Very minimal
error.yml Error handling Title, textarea, optional image Basic preset
redirect.yml URL redirection Target URL, status, delete option URL disabled for this template

Block Blueprints

Block Purpose Fields Issues
block-text Rich content Heading, text, list, margin options ✅ OK
block-text-image Content + media Description, link, multiple images, anchor, image position ✅ OK
block-team Team list Title only 🚨 Too minimal
block-contact Contact info Images, intro text, description ✅ OK
block-contact-form Contact form Description only (logic in controller) 🚨 Minimal content
block-project-overview Project overview Title only 🚨 Minimal
block_full_page_slider Full slider Image, description, link, date range, anchor, icon color ✅ OK

Field Blueprints

  • image.yml (file selector)
  • image.yml (file metadata: alt, caption, seed, accepted formats: JPG/PNG/SVG/WebP)

2️⃣ Architecture Issues Summary

  • Missing: block-service-overview.yml

  • Incomplete: block-team.yml, block-project-overview.yml, block-contact-form.yml

  • Inconsistency:

    • Block naming (block-text vs block_full_page_slider)
    • Tab usage (inconsistent across blocks)
    • Field complexity (some very minimal, some well-defined)
  • Validation gaps: Few required fields, no help text in many places


3️⃣ Goal: Add a Taxonomy System for Projects

We need a taxonomy layer to manage reusable metadata such as:

  • Technologies: e.g., Drupal, Symfony, React, Docker
  • Features: e.g., API Integration, Offline Mode, PWA Support
  • Tags: e.g., backend, frontend, e-commerce

Why a Taxonomy Layer?

  • Centralized management of categories
  • Reusable across multiple projects
  • Easier filtering & grouping in front-end templates
  • Future-proofing (e.g., can be extended for blog posts, case studies, etc.)

4️⃣ Recommended Kirby Taxonomy Implementation

4.1 Data Model

Create a /content/taxonomies/ folder to store taxonomy categories:

content/
  taxonomies/
    technologies/
      drupal/
        drupal.txt
      symfony/
        symfony.txt
    features/
      api-integration/
        api-integration.txt
      offline-mode/
        offline-mode.txt

4.2 Blueprint: Taxonomy Type

site/blueprints/pages/taxonomy.yml

title: Taxonomy
preset: page
fields:
  category:
    label: Category
    type: select
    options:
      - technology
      - feature
      - tag
    required: true
  description:
    label: Description
    type: textarea
    size: small

4.3 Blueprint: Project (Updated)

site/blueprints/pages/project.yml

title: Project
fields:
  date:
    label: Date
    type: date
    required: true
  teaser_title:
    label: Teaser Title
    type: text
    required: true
  teaser_description:
    label: Teaser Description
    type: textarea
  teaser_image:
    extends: fields/image
    required: true
  project_url:
    label: Project URL
    type: url
  technologies:
    label: Technologies
    type: pages
    multiple: true
    query: site.find("taxonomies/technologies").children
  features:
    label: Features
    type: pages
    multiple: true
    query: site.find("taxonomies/features").children
  tags:
    label: Tags
    type: pages
    multiple: true
    query: site.find("taxonomies/tags").children

4.4 Frontend Usage

<ul class="project-technologies">
  <?php foreach ($page->technologies()->toPages() as $tech): ?>
    <li><?= $tech->title() ?></li>
  <?php endforeach ?>
</ul>

5️⃣ Migration & Change Management

Step 1: Prepare

  • Create taxonomies/ page with children for technologies, features, tags
  • Migrate current project tags into taxonomy entries

Step 2: Update Blueprints

  • Replace hardcoded tags field in project.yml with pages selector

Step 3: Update Templates

  • Adapt project.php snippet to loop through selected taxonomy items

Step 4: Editor Training

  • Provide a simple doc: “How to add a new Technology or Feature”

Step 5: Version Control & Backup

  • Commit blueprint changes and content/ additions together

6️⃣ Future Enhancements

  • Filtering in Panel: Use custom sections to list projects by technology
  • Icons for Taxonomies: Add an optional icon field in taxonomy blueprint
  • API Exposure: Serve taxonomy data via Kirby API for frontend filters
  • Search Integration: Make taxonomies searchable

7️⃣ Benefits

  • ♻️ Reusability: Add/update technologies & features once
  • 🗂 Consistency: Prevent typos & duplicates
  • 🔍 Better filtering: Enables advanced project listings
  • 🚀 Scalability: Easily add new categories without blueprint rewrites

Possible Slugs

  • kirby-taxonomy-system-projects
  • project-characteristics-taxonomy-kirby
  • kirby-reusable-technologies-features
  • kirby-taxonomy-architecture-upgrade

If you want, I can also prepare a Kirby content model diagram in PlantUML showing how Project relates to Taxonomy entries. That would make the structure much easier to visualize for your future edits.

Contents