Sidebar hiding without remove image field

Hai everyone, How to remove Sidebar without skipping the image field in Frappe.Please help me with this

Hi @AAnjusha,

Which sidebar?

Can you explain? and please, share the image of the sidebar.


i want to hide this sidebar without the image field

Hi @AAnjusha,

Please apply the client/custom script.

frappe.ui.form.on('Your_DocType', {
	refresh(frm) {
		$(".form-assignments").hide();
		$(".form-attachments").hide();
		$(".form-shared").hide();
		$(".form-tags").hide();
		$(".form-sidebar-stats").hide();
		$(".list-unstyled.sidebar-menu.text-muted").hide();
	}
});

Then reload and check it, please.

Thank You!

5 Likes

it’s working Thank you!!

is it possible to hide the sidebar based on user roles, if yes can you guide please. if no how can we hide from all doctypes i mean completely hiding it everywhere

thank you

Add if condition:

if (frappe.user.has_role('Sales User') == 1) {

and set it according to the requirement.

1 Like

Thank you