How to set default view in Toggle Sidebar

Hi guys,

        Is it possible to give default enabled toggle sidebar view?


Hi guys, Is there any idea?

Hi all,
Any solution for default toggle view.

Hello @Nivedha,

Have you got any solution?


Find the page.js file:


Replace setup_sidebar_toggle() with this:

setup_sidebar_toggle() {
		let sidebar_toggle = $(".page-head").find(".sidebar-toggle-btn");
		let sidebar_wrapper = this.wrapper.find(".layout-side-section");
		if (this.disable_sidebar_toggle || !sidebar_wrapper.length) {
		} else {
			// Add this line to toggle the sidebar by default
			sidebar_toggle.attr("title", __("Toggle Sidebar")).tooltip({
				delay: { show: 600, hide: 100 },
				trigger: "hover",
			}); => {
				if (frappe.utils.is_xs() || frappe.utils.is_sm()) {
				} else {
	// Add this function to handle the default state
	toggle_sidebar_by_default(sidebar_wrapper) {
		// You can customise this logic as per your requirement
		// For example, check user preferences
		sidebar_wrapper.toggle(); // Toggle the sidebar
		this.update_sidebar_icon(); // Update the icon

** working on v14

editing in EPPnext app is not a good practice

Totally agree - this is all I could come up with to make the change though.

Would be interested in a different solution if you have one.

try to override the function from your custom app