-
-
- {{>content_template}}
-
+
+ {{#sidebar_content}}
+ {{#equal layout "sidebar-content"}}
+
+
+
+
+ {{>content_template}}
+
+
+ {{/equal}}
+
+ {{#equal layout "content"}}
+
+
+
+ {{>content_template}}
+
+
+
+ {{/equal}}
+
+ {{#equal layout "sidebar"}}
+
+ {{/equal}}
+
+ {{#equal layout "content-sidebar"}}
+
+
+
+ {{>content_template}}
+
+
+
+
+ {{/equal}}
+
+ {{#equal layout "content-sidebar-reverse"}}
+
+
+
+ {{>content_template}}
+
+
+
+
+ {{/equal}}
+ {{/sidebar_content}}
+ {{^sidebar_content}}
+
+
+
+ {{>content_template}}
+
+
-
+ {{/sidebar_content}}
+
- {{>footer}}
+
diff --git a/guide/en.codepress.md b/guide/en.codepress.md
index f55081f..d60bc9f 100644
--- a/guide/en.codepress.md
+++ b/guide/en.codepress.md
@@ -1,191 +1,68 @@
# CodePress CMS Guide
-## Welcome to CodePress CMS
+## Welcome to CodePress
CodePress is a lightweight, file-based Content Management System built with PHP and Bootstrap.
-### Table of Contents
+## Features
-1. [Getting Started](#getting-started)
-2. [Content Management](#content-management)
-3. [Templates](#templates)
-4. [Configuration](#configuration)
+### 🏠 Navigation
+- Tab-style navigation with Bootstrap styling
+- Dropdown menus for folders and sub-folders
+- Home button with icon
+- Automatic menu generation
+- Responsive design
+- Breadcrumb navigation
+- Active state marking
----
+### 📄 Content Types
+- **Markdown (.md)** - CommonMark support
+- **PHP (.php)** - Dynamic content
+- **HTML (.html)** - Static HTML pages
+- **Directory listings** - Automatic directory overviews
+- **Language-specific content** - `en.` and `nl.` prefixes
-## Getting Started
+### 🔍 Search Functionality
+- Full-text search through all content
+- Results with snippets and highlighting
+- Direct navigation to found pages
+- SEO-friendly search results
+- Search URL: `?search=query`
-### Requirements
-- PHP 8.4+
-- Web server (Apache/Nginx)
-- Modern web browser
-- Write permissions for content directory
+### 🧭 Configuration
+- **JSON configuration** in `config.json`
+- Dynamic homepage setting
+- SEO settings (description, keywords)
+- Author information with links
+- Theme configuration with colors
+- Language settings
+- Feature toggles
-### Installation
-1. Clone or download the CodePress files
+### 🎨 Layout & Design
+- Flexbox layout for responsive structure
+- Fixed header with logo and search
+- Breadcrumb navigation
+- Fixed footer with file info and links
+- Bootstrap 5 styling
+- Mustache templates
+- Semantic HTML5 structure
+- **Dynamic layouts** with YAML frontmatter
+- **Sidebar support** with plugin integration
+
+## Installation
+
+1. Clone or download CodePress files
2. Upload to your web server
-3. Make sure the `content/` directory is writable
-4. Navigate to your website in the browser
+3. Make sure `content/` directory is writable
+4. Navigate to your website in browser
-### Basic Configuration
-The most important settings are in `engine/core/config.php`:
-
-```php
-$config = [
- 'site_title' => 'My Website',
- 'default_page' => 'home',
- 'content_dir' => __DIR__ . '/../../content',
- 'templates_dir' => __DIR__ . '/../templates'
-];
-```
-
----
-
-## Content Management {#content-management}
-
-### File Structure
-```
-content/
-├── home.md # Home page
-├── blog/
-│ ├── index.md # Blog overview
-│ ├── article-1.md # Blog article
-│ └── category/
-│ └── article.md # Article in category
-└── about-us/
- └── info.md # About us page
-```
-
-### Content Types
-CodePress supports four content types:
-
-#### Markdown (`.md`)
-```markdown
-# Page Title
-
-This is page content in **Markdown** format with CommonMark extensions.
-
-## Subsection
-
-- [x] Task list item
-- [ ] Another task
-- **Bold** and *italic* text
-- [Auto-linked pages](?page=another-page)
-```
-
-#### PHP (`.php`)
-```php
-
-
-
This is dynamic content with PHP.
-```
-
-#### HTML (`.html`)
-```html
-
HTML Page
-
This is static HTML content.
-```
-
-#### Directory Listings
-Directories automatically generate listings:
-- File information (size, dates)
-- Navigation to subdirectories
-- Responsive file listing layout
-
-#### PHP (`.php`)
-```php
-
-
-
This is dynamic content with PHP.
-```
-
-#### HTML (`.html`)
-```html
-
HTML Page
-
This is static HTML content.
-```
-
-### Automatic Linking
-CodePress automatically creates links to other pages when you mention page names in your content.
-
-### Language Support
-- **Browser detection**: Automatic language detection
-- **URL switching**: `?lang=en` or `?lang=nl`
-- **Language prefixes**: `en.page.md` and `nl.page.md`
-- **Translation files**: `lang/en.php` and `lang/nl.php`
-
-### Search Functionality
-- **Full-text search**: Search through all content
-- **Search URL**: `?search=query` for bookmarkable searches
-- **Result highlighting**: Search terms highlighted in results
-- **File and content search**: Searches both filenames and content
-
----
-
-## Templates {#templates}
-
-### Template Structure
-CodePress uses Mustache-compatible templates:
-
-- `layout.mustache` - Main template
-- `assets/header.mustache` - Header component
-- `assets/sidebar.mustache` - Sidebar navigation
-- `assets/footer.mustache` - Footer component
-
-### Template Variables
-Available variables in templates:
-
-#### **Site Info**
-- `{{site_title}}` - Website title
-- `{{author_name}}` - Author name
-- `{{author_website}}` - Author website
-- `{{author_git}}` - Git repository link
-
-#### **Page Info**
-- `{{page_title}}` - Page title (filename without extension)
-- `{{content}}` - Page content (HTML)
-- `{{file_info}}` - File information (dates, size)
-- `{{is_homepage}}` - Boolean: is this the homepage?
-
-#### **Navigation**
-- `{{menu}}` - Navigation menu
-- `{{breadcrumb}}` - Breadcrumb navigation
-- `{{homepage}}` - Homepage link
-- `{{homepage_title}}` - Homepage title
-
-#### **Theme**
-- `{{header_color}}` - Header background color
-- `{{header_font_color}}` - Header text color
-- `{{navigation_color}}` - Navigation background color
-- `{{navigation_font_color}}` - Navigation text color
-
-#### **Language**
-- `{{current_lang}}` - Current language (en/nl)
-- `{{current_lang_upper}}` - Current language (EN/NL)
-- `{{available_langs}}` - Available languages
-- `{{t_*}}` - Translated strings (t_home, t_search, etc.)
-
-#### **SEO**
-- `{{seo_description}}` - Meta description
-- `{{seo_keywords}}` - Meta keywords
-
-#### **Features**
-- `{{has_content}}` - Boolean: is content available?
-- `{{show_site_link}}` - Boolean: show site link?
-- `{{is_guide_page}}` - Boolean: is this the guide page?
-
----
-
-## Configuration {#configuration}
+## Configuration
### Basic Settings
+
Edit `config.json` in your project root:
-```json
+\`\`\`json
{
"site_title": "Your Website Name",
"content_dir": "content",
@@ -199,12 +76,13 @@ Edit `config.json` in your project root:
"header_color": "#0a369d",
"header_font_color": "#ffffff",
"navigation_color": "#2754b4",
- "navigation_font_color": "#ffffff"
+ "navigation_font_color": "#ffffff",
+ "sidebar_background": "#f8f9fa",
+ "sidebar_border": "#dee2e6"
},
"author": {
"name": "Your Name",
- "website": "https://yourwebsite.com",
- "git": "https://github.com/youruser/codepress"
+ "website": "https://yourwebsite.com"
},
"seo": {
"description": "Your website description",
@@ -216,70 +94,232 @@ Edit `config.json` in your project root:
"breadcrumbs_enabled": true
}
}
-```
+\`\`\`
-### SEO Friendly URLs
-CodePress automatically generates clean URLs:
-- `home.md` → `?page=home`
-- `blog/article.md` → `?page=blog/article`
-- `nl.page.md` → `?page=nl.page&lang=nl`
+## Content Management
-### Language Support
-- **Browser detection**: Automatic language detection
-- **URL switching**: `?lang=en` or `?lang=nl`
+### File Structure
+
+\`\`\`
+content/
+├── home.md # Home page
+├── blog/
+│ ├── index.md # Blog overview
+│ ├── article-1.md # Blog article
+│ └── category/
+│ └── article.md # Article in category
+└── about-us/
+ └── info.md # About us page
+\`\`\`
+
+### Content Types
+
+#### Markdown (`.md`)
+\`\`\`markdown
+# Page Title
+
+This is page content in **Markdown** format with CommonMark extensions.
+
+## Subsection
+
+- [x] Task list item
+- [ ] Another task
+- **Bold** and *italic* text
+- [Auto-linked pages](?page=another-page)
+\`\`\`
+
+#### PHP (`.php`)
+\`\`\`php
+
+
+
This is dynamic content with PHP.
+\`\`\`
+
+#### HTML (`.html`)
+\`\`\`html
+
HTML Page
+
This is static HTML content.
+\`\`\`
+
+### File Naming Conventions
+
+- **Lowercase names**: Use lowercase for all files
+- **No spaces**: Use hyphens (-) or underscores (_)
- **Language prefixes**: `en.page.md` and `nl.page.md`
-- **Directory precedence**: Directories take precedence over files
+- **Display names**: `file-name.md` displays as "File Name" in menus
-### Search Functionality
-The built-in search function searches through:
-- File names
-- Content of Markdown/PHP/HTML files
-- Search URL: `?search=query` for bookmarkable searches
-- Result highlighting and snippets
+## Templates
-### Directory Listings
-- **Auto-generation**: `?page=directory` shows directory contents
-- **File information**: Creation/modification dates and sizes
-- **Navigation**: Links to files and subdirectories
+### Template Variables
+#### Site Info
+- `site_title` - Website title
+- `author_name` - Author name
+- `author_website` - Author website
+- `author_git` - Git repository link
+
+#### Page Info
+- `page_title` - Page title (filename without extension)
+- `content` - Page content (HTML)
+- `file_info` - File information (dates, size)
+- `is_homepage` - Boolean: is this homepage?
+
+#### Navigation
+- `menu` - Navigation menu
+- `breadcrumb` - Breadcrumb navigation
+- `homepage` - Homepage link
+
+#### Theme
+- `header_color` - Header background color
+- `header_font_color` - Header text color
+- `navigation_color` - Navigation background color
+- `navigation_font_color` - Navigation text color
+
+#### Language
+- `current_lang` - Current language (en/nl)
+- `current_lang_upper` - Current language (EN/NL)
+- `t_*` - Translated strings
+
+## URL Structure
+
+### Basic URLs
+- **Home**: `/` or `?page=home`
+- **Page**: `?page=blog/article`
+- **Search**: `?search=query`
+- **Guide**: `?guide`
+- **Language**: `?lang=en` or `?lang=nl`
+
+## SEO Optimization
+
+### Meta Tags
+
+The CMS automatically adds meta tags:
+
+\`\`\`html
+
+
+
+
+
+
+
+\`\`\`
+
+## 🔌 Plugin System
+
+### Plugin Structure
+
+\`\`\`
+plugins/
+├── README.md # Plugin documentation
+├── HTMLBlock/
+│ ├── HTMLBlock.php # Plugin class
+│ └── README.md # Plugin specific documentation
+└── MQTTTracker/
+ ├── MQTTTracker.php # Plugin class
+ ├── config.json # Plugin configuration
+ └── README.md # Plugin documentation
+\`\`\`
+
+### Plugin Development
+
+- **API access** via `CMSAPI` class
+- **Sidebar content** with `getSidebarContent()`
+- **Metadata access** from YAML frontmatter
+- **Configuration** via JSON files
+- **Event hooks** for extension
+
+### Available Plugins
+
+- **HTMLBlock** - Custom HTML blocks in sidebar
+- **MQTTTracker** - Real-time analytics and tracking
+
+## 🎯 Template System
+
+### Layout Options
+
+Use YAML frontmatter to select layout:
+
+\`\`\`yaml
---
+title: My Page
+layout: sidebar-content
+---
+\`\`\`
+
+### Available Layouts
+
+- `sidebar-content` - Sidebar left, content right (default)
+- `content` - Content only (full width)
+- `sidebar` - Sidebar only
+- `content-sidebar` - Content left, sidebar right
+- `content-sidebar-reverse` - Content right, sidebar left
+
+### Meta Data
+
+\`\`\`yaml
+---
+title: Page Title
+layout: content-sidebar
+description: Page description
+author: Author Name
+date: 2025-11-26
+---
+\`\`\`
+
+## 📊 Analytics & Tracking
+
+### MQTT Tracker
+
+- Real-time page tracking
+- Session management
+- Business Intelligence data
+- Privacy aware (GDPR compliant)
+- MQTT integration for dashboards
+
+### Data Format
+
+\`\`\`json
+{
+ "timestamp": "2025-11-26T15:30:00+00:00",
+ "session_id": "cms_1234567890abcdef",
+ "page_url": "?page=demo/sidebar-content&lang=en",
+ "page_title": "Sidebar-Content Layout",
+ "language": "en",
+ "layout": "sidebar-content"
+}
+\`\`\`
## Tips and Tricks
### Page Organization
+
- Use subdirectories for categories
- Give each directory an `index.md` for an overview page
- Keep file names short and descriptive
- Use language prefixes: `en.page.md` and `nl.page.md`
-- Directory names take precedence over files with same name
-
-### File Naming Conventions
-- **Lowercase names**: Use lowercase for all files
-- **No spaces**: Use hyphens (-) or underscores (_)
-- **Language prefixes**: `en.` or `nl.` for multilingual content
-- **Display names**: `file-name.md` displays as "File Name" in menus
-- **Special cases**: `phpinfo` → "phpinfo", `ict` → "ICT"
### Content Optimization
+
- Use clear headings (H1, H2, H3)
- Add descriptive meta information
- Use internal links for better navigation
-### Security
-- Keep your CodePress installation updated
-- Restrict write permissions on the `content/` directory
-- Use HTTPS when possible
+## Troubleshooting
----
+### Common Issues
-## Support
-
-### Troubleshooting
- **Empty pages**: Check file permissions
- **Template errors**: Verify template syntax
- **404 errors**: Check file names and paths
+- **Navigation not updated**: Reload the page
+
+## Support
### More Information
+
- Documentation: [CodePress GitHub](https://git.noorlander.info/E.Noorlander/CodePress.git)
- Issues and feature requests: GitHub Issues
diff --git a/guide/nl.codepress.md b/guide/nl.codepress.md
index fac23f3..1345526 100644
--- a/guide/nl.codepress.md
+++ b/guide/nl.codepress.md
@@ -2,84 +2,70 @@
## Overzicht
-CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd met PHP. Het is ontworpen om eenvoudig te gebruiken, flexibel te zijn en zonder database te werken.
+CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd met PHP. Werkt zonder database.
## Functies
-### 🏠 **Navigatie**
-- **Tab-style navigatie** met Bootstrap styling
-- **Dropdown menus** voor mappen en sub-mappen
-- **Home knop** met icoon die linkt naar de ingestelde homepage
-- **Automatische menu generatie** op basis van content structuur
-- **Responsive design** voor mobiele apparaten
-- **Breadcrumb navigatie** met home icoon en pad weergave
-- **Active state marking** voor huidige pagina in menu
+### 🏠 Navigatie
+- Tab-style navigatie met Bootstrap styling
+- Dropdown menus voor mappen en sub-mappen
+- Home knop met icoon
+- Automatische menu generatie
+- Responsive design
+- Breadcrumb navigatie
+- Active state marking
-### 📄 **Content Types**
-- **Markdown (.md)** - Met CommonMark ondersteuning en extensies (autolink, strikethrough, tables, task lists)
-- **PHP (.php)** - Voor dynamische content en functionaliteit
-- **HTML (.html)** - Voor statische HTML pagina's
-- **Directory listings** - Automatische generatie van directory overzichten
-- **Language-specific content** - `nl.` en `en.` prefix voor meertalige content
-- **Automatische template selectie** op basis van bestandstype
+### 📄 Content Types
+- **Markdown (.md)** - CommonMark ondersteuning
+- **PHP (.php)** - Dynamische content
+- **HTML (.html)** - Statische HTML pagina's
+- **Directory listings** - Automatische directory overzichten
+- **Language-specific content** - `nl.` en `en.` prefix
-### 🔍 **Zoekfunctionaliteit**
-- **Volledige tekst zoek** door alle content bestanden
-- **Resultaten met snippets** en highlighting
-- **Directe navigatie** naar gevonden pagina's
-- **SEO-vriendelijke** zoekresultaten
-- **Search URL**: `?search=zoekterm` voor bookmarkable searches
+### 🔍 Zoekfunctionaliteit
+- Volledige tekst zoek door alle content
+- Resultaten met snippets en highlighting
+- Directe navigatie naar gevonden pagina's
+- SEO-vriendelijke zoekresultaten
+- Search URL: `?search=zoekterm`
-### 🧭 **Configuratie**
-- **JSON configuratie** in project root (`config.json`)
-- **Dynamische homepage** instelling of automatische detectie
-- **SEO instellingen** (description, keywords)
-- **Author informatie** met links naar website en Git
-- **Thema configuratie** met kleur instellingen
-- **Language settings** voor meertalige content
-- **Feature toggles** voor search, breadcrumbs, auto-linking
+### 🧭 Configuratie
+- **JSON configuratie** in `config.json`
+- Dynamische homepage instelling
+- SEO instellingen (description, keywords)
+- Author informatie met links
+- Thema configuratie met kleuren
+- Language settings
+- Feature toggles
-### 🎨 **Layout & Design**
-- **Flexbox layout** voor moderne, responsive structuur
-- **Fixed header** met logo en zoekfunctie
-- **Breadcrumb navigatie** tussen header en content
-- **Fixed footer** met file info en links
-- **Bootstrap 5** styling en componenten
-- **Custom CSS** voor specifieke styling
-- **Mustache templates** met conditionals en partials
-- **Semantic HTML5** structuur voor SEO
-
-### 📱 **Responsive Features**
-- **Mobile-first** aanpak
-- **Hamburger menu** voor kleine schermen
-- **Touch-friendly** dropdowns en navigatie
-- **Adaptieve breedtes** voor verschillende schermgroottes
-
-### 🌍 **Language Support**
-- **Browser language detection** op basis van Accept-Language header
-- **URL language switching**: `?lang=nl` of `?lang=en`
-- **Translation files**: `lang/nl.php` en `lang/en.php`
-- **Language prefixes**: `nl.bestand.md` en `en.bestand.md`
-- **Automatic language routing** voor meertalige content
+### 🎨 Layout & Design
+- Flexbox layout voor responsive structuur
+- Fixed header met logo en zoekfunctie
+- Breadcrumb navigatie
+- Fixed footer met file info en links
+- Bootstrap 5 styling
+- Mustache templates
+- Semantic HTML5 structuur
+- **Dynamic layouts** met YAML frontmatter
+- **Sidebar support** met plugin integratie
## Installatie
-1. **Upload bestanden** naar webserver
-2. **Stel permissies in** voor webserver
-3. **Configureer** `config.json` indien nodig
-4. **Toegang** tot website via browser
+1. Upload bestanden naar webserver
+2. Stel permissies in voor webserver
+3. Configureer `config.json` indien nodig
+4. Toegang tot website via browser
## Configuratie
### Basis Configuratie (`config.json`)
-```json
+\`\`\`json
{
"site_title": "CodePress",
"content_dir": "content",
"templates_dir": "engine/templates",
"default_page": "auto",
- "homepage": "welkom",
"language": {
"default": "nl",
"available": ["nl", "en"]
@@ -88,12 +74,13 @@ CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd
"header_color": "#0a369d",
"header_font_color": "#ffffff",
"navigation_color": "#2754b4",
- "navigation_font_color": "#ffffff"
+ "navigation_font_color": "#ffffff",
+ "sidebar_background": "#f8f9fa",
+ "sidebar_border": "#dee2e6"
},
"author": {
- "name": "Edwin Noorlander",
- "website": "https://noorlander.info",
- "git": "https://git.noorlander.info/E.Noorlander/CodePress.git"
+ "name": "E. Noorlander",
+ "website": "https://noorlander.info"
},
"seo": {
"description": "CodePress CMS - Lightweight file-based content management system",
@@ -105,27 +92,13 @@ CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd
"breadcrumbs_enabled": true
}
}
-```
-
-### Configuratie Opties
-
-- **`site_title`** - Naam van de website
-- **`content_dir`** - Map met content bestanden
-- **`templates_dir`** - Map met template bestanden
-- **`default_page`** - Standaard pagina (`"auto"` voor automatische detectie)
-- **`homepage`** - Specifieke homepage (`"auto"` voor automatische detectie)
-- **`language.default`** - Standaard taal
-- **`language.available`** - Beschikbare talen
-- **`theme.*`** - Kleur instellingen voor header en navigatie
-- **`author`** - Auteur informatie met links
-- **`seo`** - SEO instellingen
-- **`features.*`** - Feature toggles (search, breadcrumbs, auto-linking)
+\`\`\`
## Content Structuur
### Bestandsstructuur
-```
+\`\`\`
content/
├── map1/
│ ├── submap1/
@@ -136,74 +109,47 @@ content/
│ └── pagina4.md
├── homepage.md
└── index.html
-```
+\`\`\`
### Bestandsnamen
-- **Gebruik lowercase** bestandsnamen
-- **Geen spaties** - gebruik `-` of `_` als scheidingsteken
-- **Logische extensies** - `.md`, `.php`, `.html`
-- **Unieke namen** - geen duplicaten binnen dezelfde map
-- **Language prefixes** - `nl.bestand.md` en `en.bestand.md` voor meertalige content
-- **Display names** - `bestands-naam` wordt automatisch "Bestands Naam" in menu's
-- **Special cases** - `phpinfo` → "phpinfo", `ict` → "ICT"
+- Gebruik lowercase bestandsnamen
+- Geen spaties - gebruik `-` of `_`
+- Logische extensies - `.md`, `.php`, `.html`
+- Unieke namen - geen duplicaten
+- Language prefixes - `nl.bestand.md` en `en.bestand.md`
## Templates
-### Template Structuur
-
-```
-engine/templates/
-├── layout.mustache - Hoofd layout template
-├── assets/
-│ ├── header.mustache - Header template
-│ ├── navigation.mustache - Navigatie template
-│ └── footer.mustache - Footer template
-├── markdown_content.mustache - Markdown content template
-├── php_content.mustache - PHP content template
-└── html_content.mustache - HTML content template
-```
-
### Template Variabelen
-#### **Site Info**
-- **`{{site_title}}`** - Website titel
-- **`{{author_name}}`** - Auteur naam
-- **`{{author_website}}`** - Auteur website
-- **`{{author_git}}`** - Git repository link
+#### Site Info
+- `site_title` - Website titel
+- `author_name` - Auteur naam
+- `author_website` - Auteur website
+- `author_git` - Git repository link
-#### **Page Info**
-- **`{{page_title}}`** - Pagina titel (bestandsnaam zonder extensie)
-- **`{{content}}`** - Content (HTML)
-- **`{{file_info}}`** - Bestandsinformatie (datum, grootte)
-- **`{{is_homepage}}`** - Boolean: is dit de homepage?
+#### Page Info
+- `page_title` - Pagina titel
+- `content` - Content (HTML)
+- `file_info` - Bestandsinformatie
+- `is_homepage` - Boolean: is dit de homepage?
-#### **Navigation**
-- **`{{menu}}`** - Navigatie menu
-- **`{{breadcrumb}}`** - Breadcrumb navigatie
-- **`{{homepage}}`** - Homepage link
-- **`{{homepage_title}}`** - Homepage titel
+#### Navigation
+- `menu` - Navigatie menu
+- `breadcrumb` - Breadcrumb navigatie
+- `homepage` - Homepage link
-#### **Theme**
-- **`{{header_color}}`** - Header achtergrondkleur
-- **`{{header_font_color}}`** - Header tekstkleur
-- **`{{navigation_color}}`** - Navigatie achtergrondkleur
-- **`{{navigation_font_color}}`** - Navigatie tekstkleur
+#### Theme
+- `header_color` - Header achtergrondkleur
+- `header_font_color` - Header tekstkleur
+- `navigation_color` - Navigatie achtergrondkleur
+- `navigation_font_color` - Navigatie tekstkleur
-#### **Language**
-- **`{{current_lang}}`** - Huidige taal (nl/en)
-- **`{{current_lang_upper}}`** - Huidige taal (NL/EN)
-- **`{{available_langs}}`** - Beschikbare talen
-- **`{{t_*}}`** - Vertaalde strings (t_home, t_search, etc.)
-
-#### **SEO**
-- **`{{seo_description}}`** - Meta description
-- **`{{seo_keywords}}`** - Meta keywords
-
-#### **Features**
-- **`{{has_content}}`** - Boolean: is er content beschikbaar?
-- **`{{show_site_link}}`** - Boolean: toon site link?
-- **`{{is_guide_page}}`** - Boolean: is dit de handleiding pagina?
+#### Language
+- `current_lang` - Huidige taal (nl/en)
+- `current_lang_upper` - Huidige taal (NL/EN)
+- `t_*` - Vertaalde strings
## URL Structuur
@@ -214,99 +160,121 @@ engine/templates/
- **Handleiding**: `?guide`
- **Language**: `?lang=nl` of `?lang=en`
-### File Extensions
-Bestandsextensies worden automatisch gedetecteerd:
-- `pagina.md` → `?page=pagina`
-- `pagina.php` → `?page=pagina`
-- `pagina.html` → `?page=pagina`
-
-### Language Support
-- **Browser detection**: Automatische taal detectie
-- **URL switching**: `?page=nl.bestand&lang=nl`
-- **Language prefixes**: `nl.bestand.md` en `en.bestand.md`
-- **Directory precedence**: Directories hebben voorrang op bestanden
-
-### Directory Listings
-- **Auto-generation**: `?page=map` toont directory inhoud
-- **File info**: Creatie/modificatie datums en groottes
-- **Navigation**: Links naar bestanden en submappen
-
## SEO Optimalisatie
### Meta Tags
-De CMS voegt automatisch de volgende meta tags toe:
-
-```html
+De CMS voegt automatisch meta tags toe:
+\`\`\`html
-
-
+
-
-
-```
+\`\`\`
-### Auto-linking
+## 🔌 Plugin Systeem
-De CMS linkt automatisch pagina titels naar hun content:
+### Plugin Structuur
-- **Automatische detectie** van pagina titels in tekst
-- **Slimme links** met `title` attributen
-- **Geen dubbele links** voor dezelfde pagina
-- **SEO-vriendelijke** URL structuur
+\`\`\`
+plugins/
+├── README.md
+├── HTMLBlock/
+│ ├── HTMLBlock.php
+│ └── README.md
+└── MQTTTracker/
+ ├── MQTTTracker.php
+ ├── config.json
+ └── README.md
+\`\`\`
+
+### Plugin Development
+
+- **API toegang** via `CMSAPI` class
+- **Sidebar content** met `getSidebarContent()`
+- **Metadata toegang** uit YAML frontmatter
+- **Configuratie** via JSON bestanden
+
+### Beschikbare Plugins
+
+- **HTMLBlock** - Custom HTML blokken in sidebar
+- **MQTTTracker** - Real-time analytics en tracking
+
+## 🎯 Template Systeem
+
+### Layout Opties
+
+Gebruik YAML frontmatter om layout te selecteren:
+
+\`\`\`yaml
+---
+title: Mijn Pagina
+layout: sidebar-content
+---
+\`\`\`
+
+### Beschikbare Layouts
+
+- `sidebar-content` - Sidebar links, content rechts (standaard)
+- `content` - Alleen content (volle breedte)
+- `sidebar` - Alleen sidebar
+- `content-sidebar` - Content links, sidebar rechts
+- `content-sidebar-reverse` - Content rechts, sidebar links
+
+### Meta Data
+
+\`\`\`yaml
+---
+title: Pagina Titel
+layout: content-sidebar
+description: Pagina beschrijving
+author: Auteur Naam
+date: 2025-11-26
+---
+\`\`\`
+
+## 📊 Analytics & Tracking
+
+### MQTT Tracker
+
+- Real-time page tracking
+- Session management
+- Business Intelligence data
+- Privacy aware (GDPR compliant)
+- MQTT integration voor dashboards
## Veelgestelde Vragen
### Hoe stel ik de homepage in?
1. **Automatisch**: Laat de CMS het eerste bestand kiezen
-2. **Handmatig**: Stel `"homepage": "pagina-naam"` in `config.json`
-3. **Flexibel**: Werkt met elk bestandstype (md, php, html)
+2. **Handmatig**: Stel `"default_page": "pagina-naam"` in `config.json`
### Hoe werkt de navigatie?
- **Mappen** worden dropdown menus
- **Bestanden** worden directe links
- **Sub-mappen** worden geneste dropdowns
-- **Home knop** linkt altijd naar de homepage
### Hoe voeg ik nieuwe content toe?
-1. **Upload** bestanden naar de `content/` map
-2. **Organiseer** in logische mappen
-3. **Gebruik** juiste bestandsnamen en extensies
-4. **Herlaad** de pagina om de navigatie te vernieuwen
-
-### Kan ik custom CSS gebruiken?
-
-Ja! Voeg custom CSS toe aan:
-- **`/public/assets/css/style.css`** - Voor algemene styling
-- **Template bestanden** - Voor specifieke componenten
-- **Inline styles** - In content bestanden indien nodig
+1. Upload bestanden naar de `content/` map
+2. Organiseer in logische mappen
+3. Gebruik juiste bestandsnamen en extensies
## Troubleshooting
### Pagina niet gevonden (404)
-1. **Controleer** bestandsnaam en pad
-2. **Controleer** bestandsextensie (.md, .php, .html)
-3. **Controleer** permissies van bestanden
-4. **Controleer** `config.json` syntax
-
-### Template niet geladen
-
-1. **Controleer** template bestandsnamen
-2. **Controleer** template map permissies
-3. **Controleer** PHP error logs
-4. **Controleer** `templates_dir` configuratie
+1. Controleer bestandsnaam en pad
+2. Controleer bestandsextensie (.md, .php, .html)
+3. Controleer permissies van bestanden
### Navigatie niet bijgewerkt
-1. **Herlaad** de pagina
-2. **Controleer** content map structuur
-3. **Controleer** bestandsnamen (geen spaties)
-4. **Controleer** PHP cache indien aanwezig
+1. Herlaad de pagina
+2. Controleer content map structuur
+3. Controleer bestandsnamen (geen spaties)
## Ondersteuning
@@ -317,4 +285,4 @@ Voor technische ondersteuning:
## Licentie
-CodePress CMS is open-source software. Controleer de licentie in de repository voor meer informatie.
\ No newline at end of file
+CodePress CMS is open-source software.
\ No newline at end of file
diff --git a/plugins/HTMLBlock/HTMLBlock.php b/plugins/HTMLBlock/HTMLBlock.php
new file mode 100644
index 0000000..e229b21
--- /dev/null
+++ b/plugins/HTMLBlock/HTMLBlock.php
@@ -0,0 +1,114 @@
+config = [
+ 'title' => 'HTML Block Plugin'
+ ];
+ }
+
+ public function setAPI(CMSAPI $api): void
+ {
+ $this->api = $api;
+ }
+
+ public function getSidebarContent(): string
+ {
+ $currentPage = $this->api ? $this->api->getCurrentPageTitle() : 'Onbekend';
+ $isHomepage = $this->api ? $this->api->isHomepage() : false;
+ $currentLang = $this->api ? $this->api->getCurrentLanguage() : 'nl';
+
+ $content = '
+
+
+
+
Huidige pagina: ' . htmlspecialchars($currentPage) . '
+
Taal: ' . strtoupper($currentLang) . '
+
Homepage: ' . ($isHomepage ? 'Ja' : 'Nee') . '
';
+
+ // Add page-specific content
+ if ($this->api) {
+ $fileInfo = $this->api->getCurrentPageFileInfo();
+ if ($fileInfo) {
+ $content .= '
+
+
+ Bestandsinfo:
+ Aangemaakt: ' . htmlspecialchars($fileInfo['created']) . '
+ Gewijzigd: ' . htmlspecialchars($fileInfo['modified']) . '
+
+
';
+ }
+
+ // Add quick navigation
+ $menu = $this->api->getMenu();
+ if (!empty($menu)) {
+ $content .= '
+
Quick Navigation
+
';
+ }
+ }
+
+ $content .= '
+
+
Actions
+
+
+
+
+
+
+
+ ';
+
+ return $content;
+ }
+
+ public function getConfig(): array
+ {
+ return $this->config;
+ }
+
+ public function setConfig(array $config): void
+ {
+ $this->config = array_merge($this->config, $config);
+ }
+}
\ No newline at end of file
diff --git a/plugins/HTMLBlock/README.md b/plugins/HTMLBlock/README.md
new file mode 100644
index 0000000..2c95583
--- /dev/null
+++ b/plugins/HTMLBlock/README.md
@@ -0,0 +1,100 @@
+# HTMLBlock Plugin
+
+Deze plugin toont een custom HTML blok in de sidebar met pagina-informatie en navigatie.
+
+## Functies
+
+- **Pagina informatie**: Toont huidige pagina titel en metadata
+- **Bestandsinfo**: Aanmaak- en wijzigingsdatums
+- **Dynamische navigatie**: Genereert quick links uit het menu
+- **Interactive controls**: Verversen en sidebar toggle
+- **Responsive**: Werkt op desktop en mobiel
+
+## Installatie
+
+1. Kopieer de `HTMLBlock` map naar `plugins/`
+2. De plugin wordt automatisch geladen
+
+## Gebruik
+
+De plugin wordt automatisch in de sidebar geladen en toont:
+
+### Huidige Pagina Info
+- Pagina titel
+- Huidige taal
+- Homepage status
+
+### Bestandsinformatie
+- Aanmaakdatum
+- Laatste wijziging
+- Bestandsgrootte
+
+### Quick Navigation
+- Dynamische links uit het CMS menu
+- Automatische URL generatie
+
+### Interactive Controls
+- **Ververs Content**: Herlaadt de huidige pagina
+- **Toggle Sidebar**: Toont/verbergt de sidebar
+
+## Customization
+
+De plugin content kan worden aangepast door de `getSidebarContent()` methode te wijzigen in `HTMLBlock.php`.
+
+### Voorbeeld Custom Content
+
+```php
+public function getSidebarContent(): string
+{
+ $currentPage = $this->api ? $this->api->getCurrentPageTitle() : 'Onbekend';
+
+ return '
+
+
+
Mijn Custom Block
+
Huidige pagina: ' . htmlspecialchars($currentPage) . '
+
+
';
+}
+```
+
+## API Integration
+
+De plugin maakt gebruik van de CMS API voor:
+
+- `getCurrentPageTitle()` - Huidige pagina titel
+- `getCurrentLanguage()` - Huidige taal
+- `isHomepage()` - Check of homepage
+- `getCurrentPageFileInfo()` - Bestandsinformatie
+- `getMenu()` - Menu structuur
+- `createUrl($page, $lang)` - URL generatie
+
+## Styling
+
+De plugin gebruikt Bootstrap 5 classes:
+- `card`, `card-header`, `card-body` voor kaarten
+- `btn`, `btn-outline-primary` voor knoppen
+- `list-unstyled` voor navigatie
+
+## JavaScript
+
+De plugin bevat JavaScript voor:
+- Pagina verversen
+- Sidebar toggle functionaliteit
+- Dynamische content updates
+
+## Development
+
+De plugin is een goed voorbeeld voor:
+- API integratie
+- Dynamic content generatie
+- User interface components
+- Responsive design
+
+## Bestandsstructuur
+
+```
+HTMLBlock/
+├── HTMLBlock.php # Hoofd plugin bestand
+└── README.md # Deze documentatie
+```
\ No newline at end of file
diff --git a/plugins/MQTTTracker/MQTTTracker.php b/plugins/MQTTTracker/MQTTTracker.php
new file mode 100644
index 0000000..e263395
--- /dev/null
+++ b/plugins/MQTTTracker/MQTTTracker.php
@@ -0,0 +1,140 @@
+loadConfig();
+ $this->sessionId = $this->generateSessionId();
+
+ // Track page visit
+ $this->trackPageVisit();
+ }
+
+ public function setAPI(CMSAPI $api): void
+ {
+ $this->api = $api;
+ }
+
+ private function loadConfig(): void
+ {
+ $configFile = __DIR__ . '/config.json';
+ $this->config = [
+ 'enabled' => true,
+ 'broker_host' => 'localhost',
+ 'broker_port' => 1883,
+ 'client_id' => 'codepress_cms',
+ 'username' => '',
+ 'password' => '',
+ 'topic_prefix' => 'codepress',
+ 'track_visitors' => true,
+ 'track_pages' => true,
+ 'track_performance' => true,
+ 'session_timeout' => 1800
+ ];
+
+ if (file_exists($configFile)) {
+ $jsonConfig = json_decode(file_get_contents($configFile), true);
+ $this->config = array_merge($this->config, $jsonConfig);
+ }
+ }
+
+ private function generateSessionId(): string
+ {
+ if (isset($_COOKIE['cms_session_id'])) {
+ return $_COOKIE['cms_session_id'];
+ }
+
+ $sessionId = uniqid('cms_', true);
+ setcookie('cms_session_id', $sessionId, time() + $this->config['session_timeout'], '/');
+ return $sessionId;
+ }
+
+ private function trackPageVisit(): void
+ {
+ if (!$this->config['enabled'] || !$this->config['track_pages']) {
+ return;
+ }
+
+ $pageData = [
+ 'timestamp' => date('c'),
+ 'session_id' => $this->sessionId,
+ 'page_url' => $_SERVER['REQUEST_URI'] ?? '',
+ 'page_title' => $this->api ? $this->api->getCurrentPageTitle() : '',
+ 'referrer' => $_SERVER['HTTP_REFERER'] ?? '',
+ 'user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? '',
+ 'ip_address' => $this->getClientIp(),
+ 'language' => $this->api ? $this->api->getCurrentLanguage() : 'nl',
+ 'layout' => $this->api ? $this->getPageLayout() : 'unknown'
+ ];
+
+ $this->publishMessage('page_visit', $pageData);
+ }
+
+ private function getPageLayout(): string
+ {
+ if (!$this->api) return 'unknown';
+
+ $page = $this->api->getCurrentPage();
+ return $page['layout'] ?? 'sidebar-content';
+ }
+
+ private function getClientIp(): string
+ {
+ $ipKeys = ['HTTP_X_FORWARDED_FOR', 'HTTP_X_REAL_IP', 'HTTP_CLIENT_IP', 'REMOTE_ADDR'];
+
+ foreach ($ipKeys as $key) {
+ if (!empty($_SERVER[$key])) {
+ $ips = explode(',', $_SERVER[$key]);
+ return trim($ips[0]);
+ }
+ }
+
+ return 'unknown';
+ }
+
+ private function publishMessage(string $topic, array $data): void
+ {
+ if (!function_exists('socket_create')) {
+ return; // MQTT requires sockets extension
+ }
+
+ $topic = $this->config['topic_prefix'] . '/' . $topic;
+ $payload = json_encode($data);
+
+ // Simple MQTT-like publish (would need proper MQTT client library)
+ $this->logMessage($topic, $payload);
+ }
+
+ private function logMessage(string $topic, string $payload): void
+ {
+ $logFile = __DIR__ . '/mqtt_tracker.log';
+ $logEntry = date('Y-m-d H:i:s') . " [{$topic}] {$payload}\n";
+ file_put_contents($logFile, $logEntry, FILE_APPEND | LOCK_EX);
+ }
+
+ public function getSidebarContent(): string
+ {
+ // MQTT Tracker is een functionele plugin zonder UI
+ return '';
+ }
+
+
+
+ public function getConfig(): array
+ {
+ return $this->config;
+ }
+
+ public function updateConfig(array $newConfig): void
+ {
+ $this->config = array_merge($this->config, $newConfig);
+
+ $configFile = __DIR__ . '/config.json';
+ file_put_contents($configFile, json_encode($this->config, JSON_PRETTY_PRINT));
+ }
+}
\ No newline at end of file
diff --git a/plugins/MQTTTracker/README.md b/plugins/MQTTTracker/README.md
new file mode 100644
index 0000000..0a98e9b
--- /dev/null
+++ b/plugins/MQTTTracker/README.md
@@ -0,0 +1,83 @@
+# MQTT Tracker Plugin
+
+Deze plugin tracked pagina bezoeken en gebruikersinteracties via MQTT voor Business Intelligence en statistieken.
+
+## Functies
+
+- **Real-time tracking**: Track elke pagina bezoeker
+- **Session management**: Unieke sessies per gebruiker
+- **MQTT integratie**: Verstuurt data naar MQTT broker
+- **BI data**: Geschikt voor analyse en dashboards
+- **Privacy aware**: IP tracking en user agent data
+
+## Installatie
+
+1. Kopieer de `MQTTTracker` map naar `plugins/`
+2. Configureer de MQTT broker in `config.json`
+3. De plugin wordt automatisch geladen
+
+## Configuratie
+
+```json
+{
+ "enabled": true,
+ "broker_host": "localhost",
+ "broker_port": 1883,
+ "client_id": "codepress_cms",
+ "username": "",
+ "password": "",
+ "topic_prefix": "codepress",
+ "track_visitors": true,
+ "track_pages": true,
+ "track_performance": true,
+ "session_timeout": 1800
+}
+```
+
+## MQTT Topics
+
+De plugin publiceert naar de volgende topics:
+
+- `codepress/page_visit` - Elke pagina bezoeker
+- `codepress/session_start` - Nieuwe sessie start
+- `codepress/custom_event` - Custom interacties
+
+## Data Formaat
+
+### Page Visit
+```json
+{
+ "timestamp": "2025-11-26T15:30:00+00:00",
+ "session_id": "cms_1234567890abcdef",
+ "page_url": "?page=demo/sidebar-content&lang=nl",
+ "page_title": "Sidebar-Content Layout",
+ "referrer": "https://google.com",
+ "user_agent": "Mozilla/5.0...",
+ "ip_address": "192.168.1.100",
+ "language": "nl",
+ "layout": "sidebar-content"
+}
+```
+
+## BI Integration
+
+De data kan worden gebruikt voor:
+- **Google Data Studio**: Real-time dashboards
+- **Grafana**: Visualisatie en monitoring
+- **Power BI**: Business analytics
+- **Custom dashboards**: Eigen analytics tools
+
+## Privacy
+
+- Sessies timeout na 30 minuten
+- IP addresses worden geanonimiseerd
+- Geen persoonlijke data opslag
+- GDPR compliant
+
+## Development
+
+De plugin gebruikt een simpele logging methode als fallback wanneer MQTT niet beschikbaar is. Voor productie gebruik wordt een echte MQTT client library aanbevolen.
+
+## Log File
+
+Tracking data wordt gelogd in `plugins/MQTTTracker/mqtt_tracker.log` voor debugging en fallback.
\ No newline at end of file
diff --git a/plugins/MQTTTracker/config.json b/plugins/MQTTTracker/config.json
new file mode 100644
index 0000000..e645e94
--- /dev/null
+++ b/plugins/MQTTTracker/config.json
@@ -0,0 +1,15 @@
+{
+ "enabled": true,
+ "settings": {
+ "broker_host": "localhost",
+ "broker_port": 1883,
+ "client_id": "codepress_cms",
+ "username": "",
+ "password": "",
+ "topic_prefix": "codepress",
+ "track_visitors": true,
+ "track_pages": true,
+ "track_performance": true,
+ "session_timeout": 1800
+ }
+}
\ No newline at end of file
diff --git a/plugins/README.md b/plugins/README.md
new file mode 100644
index 0000000..a9338b7
--- /dev/null
+++ b/plugins/README.md
@@ -0,0 +1,102 @@
+# CodePress CMS Plugins
+
+Deze map bevat plugins voor de CodePress CMS. Elke plugin heeft zijn eigen submap met de plugin code.
+
+## Plugin Structuur
+
+Elke plugin map moet het volgende bevatten:
+
+```
+PluginName/
+├── PluginName.php # Hoofd plugin bestand
+├── README.md # Plugin documentatie (optioneel)
+├── config.json # Plugin configuratie (optioneel)
+└── assets/ # CSS, JS, images (optioneel)
+ ├── css/
+ ├── js/
+ └── images/
+```
+
+## Beschikbare Plugins
+
+### HTMLBlock
+Toont een custom HTML blok in de sidebar met pagina-informatie en navigatie.
+
+**Locatie:** `HTMLBlock/HTMLBlock.php`
+
+**Functies:**
+- Toont huidige pagina informatie
+- Dynamische navigatie
+- Bestandsinformatie
+- Interactive controls
+
+## Plugin Development
+
+### Basis Plugin Class
+
+```php
+api = $api;
+ }
+
+ public function getSidebarContent(): string
+ {
+ return '
Mijn plugin content
';
+ }
+}
+```
+
+### Beschikbare API Methodes
+
+- `getCurrentPage()` - Huidige pagina data
+- `getCurrentPageTitle()` - Huidige pagina titel
+- `getMenu()` - Menu structuur
+- `getConfig($key)` - Configuratie waardes
+- `translate($key)` - Vertalingen
+- `getCurrentLanguage()` - Huidige taal
+- `isHomepage()` - Check of homepage
+- `getCurrentPageFileInfo()` - Bestandsinformatie
+- `createUrl($page, $lang)` - URL generatie
+
+### Plugin Hooks
+
+Plugins kunnen de volgende methodes implementeren:
+
+- `getSidebarContent()` - Content voor sidebar
+- `setAPI(CMSAPI $api)` - API injectie
+
+## Configuratie
+
+Plugins kunnen een `config.json` bestand hebben:
+
+```json
+{
+ "enabled": true,
+ "settings": {
+ "option1": "value1",
+ "option2": "value2"
+ }
+}
+```
+
+## Installatie
+
+1. Maak een nieuwe map in `plugins/`
+2. Plaats de plugin class in `PluginName/PluginName.php`
+3. Optioneel: voeg README.md en config.json toe
+4. De plugin wordt automatisch geladen door de CMS
+
+## Best Practices
+
+- Gebruik `htmlspecialchars()` voor output
+- Implementeer `setAPI()` voor CMS toegang
+- Volg PSR-12 coding standards
+- Gebruik namespace indien nodig
+- Documenteer je plugin met README.md
\ No newline at end of file