Trouble generating Custom desk page with sidebar and mainbody

Created a new custom page for my custom module list on my custom app and was able to generate the sidebar which contains a lists of doctypes which for my case act as modules.
Can anyone help me generate the main page content
Thanks in advance
screenshots


here’s my code generating the page

frappe.pages['menu-mpya'].on_page_load = function(wrapper) {
	var page = frappe.ui.make_app_page({
		parent: wrapper,
		title: 'Menu Mpya',
		single_column: false
	});

	frappe.breadcrumbs.add("Frappe Light") 

	frappe.modules_page = page;

	let get_sidebar_html = () => {
		var sidebar_items = [];
		var sidebar_items_html = '';
		frappe.call({
	        method: 'frappe_light.frappe_light.page.menu_mpya.menu_mpya.get_menu_details',
	        async: false,
	        args: {
	        	doctype:"Menu Items",     
	            fields: [ "item_label","item_type", "item_link"],
	            parent: ["Custom Menu"],
	      	},

	      	callback: function(menu_items) {
		      	sidebar_items = menu_items.message;
		        //var a=r.message[0]
		        console.log(menu_items);

	        	sidebar_items.forEach(function(item, index){
					var item_html = `<li class="strong module-sidebar-item">
						<a class="module-link" data-name="${item.item_link}" href="#List/${item.item_link}/">
							<i class="fa fa-chevron-right pull-right" style="display: none;"></i>
							<span>${item.item_label}</span>
						</a>
					</li>`;
					sidebar_items_html += item_html;
				});
				console.log(sidebar_items_html);
				page.sidebar.html(`<ul class="module-sidebar-nav overlay-sidebar nav nav-pills nav-stacked">
					${sidebar_items_html}
					<li class="divider"></li>
				</ul>`);
	        }
	     });
	};

	// render sidebar
	page.sidebar.html(get_sidebar_html());

	// render main


};

frappe.pages['menu-mpya'].on_page_show = function(wrapper) {
	$("body").attr("data-sidebar", 1);
};

1 Like

Solved using frappe.call to get my main page data and wrapper to append to the main layout section.

frappe.call({
		method: "frappe_light.frappe_light.page.dashboard.dashboard.get_dashboard_info",
		callback: function(data) {
      		const chart_data = data.message;
			console.log(data);
			var invoice_var ;
			var invoice_value;
			var po_var;
			var po_value;
			var quot_var;
			var quot_value;
			var po_var_yearly;
			var po_value_yearly;
			chart_data.forEach(function(item, index){
				if (item.total_count_weekly) {
					invoice_var = item.total_count_weekly;
					invoice_value = item.total_value_weekly;
				}
			})
			wrapper = $(wrapper).find('.layout-main-section');
			wrapper.append(`
					<table class="form-grid" width="100%">