Fix formatDisplayName for language-specific directory names

- Add regex to handle nl.php-testen -> php-testen patterns
- Remove test directories that were cluttering navigation
- Clean up content directory to remove test files
- Language filtering now works correctly for both files and directories
- Navigation shows only relevant content for selected language
This commit is contained in:
Edwin Noorlander 2025-11-22 16:41:36 +01:00
parent 14a6cae499
commit b31a82001e

View File

@ -541,6 +541,11 @@ class CodePressCMS {
$filename = $matches[2];
}
// Remove language prefixes from directory names (nl.php-testen -> php-testen)
if (preg_match('/^(nl|en)\.php-(.+)$/', $filename, $matches)) {
$filename = 'php-' . $matches[2];
}
// Handle special cases first
if (strtolower($filename) === 'phpinfo') {
return 'phpinfo';