Template Integration in Frappe

I have created a template in template/ directory . Now what are the steps to make this template appear in portal . i.e, how i can make this template render in portal ?

In the Website > Website Setting, select your Custom Portal.

Thanks for the reply umair.

I want to make some HTML dynamic pages with the help of jinja showing some graphs and charts. So I want to know that how ERPNext calls the Templates. What is the flow in which I can add custom HTML Pages to be accessed in Framework. (I don’t know how to add templates in application by hooking or doing something else?). So , It will be helpful If you can provide some links which will be helpful in creating templates and hooking them into ERPNext.

Plz any one help on this.[quote=“akash_jadav, post:4, topic:19551”]
I want to make some HTML dynamic pages with the help of jinja showing
some graphs and charts. So I want to know that how ERPNext calls the
Templates. What is the flow in which I can add custom HTML Pages to be
accessed in Framework. (I don’t know how to add templates in application
by hooking or doing something else?). So , It will be helpful If you
can provide some links which will be helpful in creating templates and
hooking them into ERPNext.
[/quote]

Follow Following Steps In Order to embed your own Pages inside Frappe:

  1. Inside Your App → templates / pages . Create Two Files with same name but with different extensions (example.html , example.py)
  2. Extend templates/web.html from frappe inside the html file
  3. inside python file create one function get_context(context):
    Inside this function perform logic and assign resign to variables such as context.result = # your solution
  4. Now In html File You will be able to access your this result using jinja syntax such as {{ result }}. Store this result in js var and display it as per your requirement.

In this way you can create your own dynamic pages in Framework.

3 Likes

Thanks Akash_jadav .I will try this.

Suppose we create a form in the template. How can we get form data from that template?

I am trying your explanation, it doesn’t seem to work

This should be helpful as well.

1 Like

Excellent video, congrats