How are Pages supposed to work?

The documentation isn’t very clear on this at all…

I have a custom app called geotools that is installed along with ERPNext.

I want to create a Page for desk users. I created the page using the Page doctype and named it mapleads. I then created an index.html file at frappe-bench/apps/geotools/geotools/www/mapleads/index.html

As I understand it, since the name of the page and the name of the html directory match, the HTML content should be loaded from my custom app, however there is no HTML loaded.

How are Pages supposed to work?

Hi @oguruma:

Read this:

And take a look here:

Hope this helps.

Thanks for the input, but I still don’t get it…

Do I even need to use the Page DocType? The documentation mentions absolutely nothing about that…

If so, how do I actually add the page’s html/js/css? Why can’t I just create a custom Desk page via code in the app?

I tried making a Page (as in a Page Document) called mypage, and then created an index.html file at mycustomapp/mycustomapp/page/mypage/index.html

I did build, migrate , clear-cache and rebooted the server and still nothing loads…

Hi @oguruma:

For desk pages, you can use html templates, but all is built from .js file

Check how other pages are made…

Hope this helps.

I appreciate it @avc ,that makes sense. It looks like when you create a Page, Frappe put the page code in the module directory under modulename/page/mypage.

Is there a way to create the page Document with code in the custom app? For example, I need to package the map UI page with the app, and not rely on the end-user manually creating the Page document in ERPNext.