How to use custom html block

i want to create a user profile section in an ERPNext dashboard workspace and display user details

@neha write all elements in html like this :

<div id="full_name"></div>
<div id="email"></div>

write js code to fill all the elements like this :

 frappe.call({
    method: "frappe.client.get",
        args: {
            doctype: "User",
            name: frappe.session.user,
             },
             callback(r) {
                 if(r.message) {
                    root_element.querySelector("#full_name").textContent=r.message.full_name;
                    root_element.querySelector('#email').textContent=r.message.email;
                 }
             }
});

you should see something like this :

next use css to beautify it .

5 Likes

Thank You!

How to display the Company details from company doctype?

How can the item button be fetched to display in the same way inside the custom html block
Because I do not want the page to be reloaded when I press the button