How to add content in a custom page

How to add content in a custom page after creating page from page list>new
I added some html content inside page.html filefor this page but nothing appear

Try
bench build
and/or
bench restart

1 Like

from this post :

I have edit my page.js file as follows and it works now

frappe.pages['test'].on_page_load = function(wrapper) {
    new TestPage(wrapper);

}
TestPage=Class.extend({
    init:function(wrapper){
            this.page=frappe.ui.make_app_page({
            parent: wrapper,
            title: 'Charts',
.pages['test'].on_page_load = function(wrapper) {
    new TestPage(wrapper);

}
 TestPage=Class.extend({
    init:function(wrapper){
            this.page=frappe.ui.make_app_page({
            parent: wrapper,
            title: 'Charts',
            single_column: true

    });
    this.make();
    },

         page.add_menu_item('Employees', () => frappe.set_route('List', 'Employee'))

    make: function() {
            $(frappe.render_template("test", this)).appendTo(this.page.main);
    }

})

this frappe.render_template is what we need to render HTML on frappe according to docs
https://frappeframework.com/docs/user/en/api/jinja#frapperender_template

1 Like