I would like to set default to collapse the sidebar menu, I have already tried overriding the page.js for sidebar function, but it doesn’t work for me. Maybe someone could guide me on how to solve my problem. Thank you
Best Regards,
Peter John
I would like to set default to collapse the sidebar menu, I have already tried overriding the page.js for sidebar function, but it doesn’t work for me. Maybe someone could guide me on how to solve my problem. Thank you
Best Regards,
Peter John
use Frappe version 16 it have collapse sidebar menu
Thank you. Is it compatible to use Frappe version 16 while using ERPNext version 15?
No, Frappe and ERPNext must have the same major version.
Okay thanks, but can I ask question if it is possible to set the sidebar default to collapse in V15?
Try using this client script:
frappe.ready(function() {
// Collapse sidebar by default
const sidebar = document.querySelector(“.layout-side-section”);
const collapseBtn = document.querySelector(“.sidebar-toggle”);
if (sidebar && collapseBtn) {
// Check if sidebar is not already collapsed
if (!sidebar.classList.contains("collapsed")) {
collapseBtn.click(); // triggers collapse
}
} });