From 2d934702cd4777d78aec453b52893b72ec13fc65 Mon Sep 17 00:00:00 2001 From: Edwin Noorlander Date: Sat, 22 Nov 2025 15:54:40 +0100 Subject: [PATCH] Fix language persistence across navigation and breadcrumbs - Add lang parameter to all navigation links in scanDirectory method - Update homepage link in navigation template to include current language - Fix breadcrumb navigation to preserve language parameter - Ensure language selection persists when clicking any navigation element --- engine/core/class/CodePressCMS.php | 8 ++++---- engine/templates/assets/navigation.mustache | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/core/class/CodePressCMS.php b/engine/core/class/CodePressCMS.php index 245a5ea..8a5be37 100644 --- a/engine/core/class/CodePressCMS.php +++ b/engine/core/class/CodePressCMS.php @@ -128,7 +128,7 @@ class CodePressCMS { 'type' => 'file', 'title' => $title, 'path' => $pathWithoutExt, - 'url' => '?page=' . $pathWithoutExt + 'url' => '?page=' . $pathWithoutExt . '&lang=' . $this->currentLanguage ]; } } @@ -891,7 +891,7 @@ class CodePressCMS { */ private function generateBreadcrumb() { if (isset($_GET['search'])) { - return ''; + return ''; } $page = $_GET['page'] ?? $this->config['default_page']; @@ -904,7 +904,7 @@ class CodePressCMS { $breadcrumb = '