Edwin Noorlander 9c5a43c5ce Fix guide template variable replacement and enhance documentation
- Fix template variable replacement in guide pages by removing {{}} brackets
- Escape code blocks in guide markdown to prevent template processing
- Completely rewrite guide documentation with comprehensive CMS features
- Add bilingual guide support (English/Dutch) with detailed examples
- Enhance CodePressCMS core with improved guide page handling
- Update template system with better layout and footer components
- Improve language files with additional translations
- Update configuration with enhanced theme and language settings

Resolves issue where guide pages were showing replaced template variables
instead of displaying them as documentation examples.
2025-11-26 16:50:49 +01:00

2.3 KiB

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

public function getSidebarContent(): string
{
    $currentPage = $this->api ? $this->api->getCurrentPageTitle() : 'Onbekend';
    
    return '
        <div class="card">
            <div class="card-body">
                <h5>Mijn Custom Block</h5>
                <p>Huidige pagina: ' . htmlspecialchars($currentPage) . '</p>
            </div>
        </div>';
}

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