diff --git a/config.php b/config.php
index 8d97779..50a4543 100755
--- a/config.php
+++ b/config.php
@@ -105,6 +105,9 @@ try {
}
$sidebarHtml = '
' . renderTree($categoryTree) . '
';
+ if (strlen($sidebarHtml) > 50000) { // If too large, use menu
+ $sidebarHtml = '';
+ }
} catch (Exception $e) {
error_log('Error building category tree: ' . $e->getMessage());
$sidebarHtml = '';