Frappe. Stuck with WebsiteGenerator

Hi, I am trying to follow this tutorial Generators
This is not very informative.

What I am trying to achieve:

  • I want to change Web View of DocType using Website Generator.

What I am doing:

  • I created doctype named Item.

  • I created class that inherits from WebsiteGenerator

    class Item(website_generator.WebsiteGenerator):
      website = frappe._dict(
          template = "templates/item.html",
      	condition_field = "publish",
      def get_context(self, context):
      	context.some_context = 'some_context'
  • Added my DocType into list website_generators in

  • Created html-file ‘item.html’ in templates

What i am getting:

  • Nothing. Web View of this doctype does not change.
  • I accidentally found out how to change web view of DocTypes list, this is very good.

Do i need to specify value for a field “route” for a doctype?

Hi welcome to ERPNext,

Have you checked the video and posts like these for clues Route always showing me http://localhost:8000/undefined

Yes this product and docs are a work in progress, together this community and forum can help improve that.

A code search like this may help you with clues

frappe@ubuntu:~/frappe-bench$ find . -name '*.py' | xargs grep WebsiteGenerator