Generators in frappe

104 views
Skip to first unread message

saurabh palande

unread,
Jul 22, 2014, 7:48:25 AM7/22/14
to erpnext-dev...@googlegroups.com
Hi Rushabh,

I want to add a new page similar to Contact Us. I made a go through, I figured out that we have to add Template and Controller in Website Route.

When I tried to create new record in Website Route, it not permits me (logged in as Administrator) . So I have created a web page and then I am trying to change the Template and Controller's path but these two fields are not editable.

Please let me know the correct way for achieveing the same.

Thanks,
Saurabh Palande

Rushabh Mehta

unread,
Jul 22, 2014, 8:06:13 AM7/22/14
to erpnext-dev...@googlegroups.com
Website Route is created automatically. Use `frappe --build_website` after you create your page.

--
Note:
 
If you are posting an issue,
 
1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/c2382d0e-bac0-4522-9d6a-8fc4111b9e70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Saurabh Palande

unread,
Jul 22, 2014, 8:53:46 AM7/22/14
to erpnext-dev...@googlegroups.com
Hi Rushabh,

Thank You.



For more options, visit https://groups.google.com/d/optout.



--
S.S.Palande

Saurabh Palande

unread,
Sep 9, 2014, 10:54:39 AM9/9/14
to erpnext-dev...@googlegroups.com
Hi Rushabh,

I have created a `registration.html` and `registration.py`. Then I execute `frappe --build_website`.
But this haven't  create a page. Also there is no doctype named as 'Website Route'.  
Please let me know whether I am missing .

Thanks,
--
S.S.Palande

Rushabh Mehta

unread,
Sep 10, 2014, 1:16:19 AM9/10/14
to erpnext-dev...@googlegroups.com
You have to add it to hooks.py and subclass from WebsiteGenerator




Saurabh Palande

unread,
Sep 10, 2014, 9:06:35 AM9/10/14
to erpnext-dev...@googlegroups.com
Hi Rushabh,

I have created an App, named ass FX. Under template folder i have added registration.html and registration.py. 
Then I have added `website_generators = ["registration"]`  in hooks.py  under my app.
But I am not getting whether to extend WebsiteGenerator. 

           page name is reg1.html, reg1.py and hooks entry is like  `website_generators = ["reg1"]`

I want to achieve similar structure like contact us page.

Thanks, 


For more options, visit https://groups.google.com/d/optout.



--
S.S.Palande

Rushabh Mehta

unread,
Sep 11, 2014, 1:07:11 AM9/11/14
to erpnext-dev...@googlegroups.com
On 10-Sep-2014, at 6:36 pm, Saurabh Palande <saura...@gmail.com> wrote:

Hi Rushabh,

I have created an App, named ass FX. Under template folder i have added registration.html and registration.py. 
Then I have added `website_generators = ["registration"]`  in hooks.py  under my app.
But I am not getting whether to extend WebsiteGenerator. 

           page name is reg1.html, reg1.py and hooks entry is like  `website_generators = ["reg1"]`

I want to achieve similar structure like contact us page.

You have to put it in templates/pages

no need to add generators

Saurabh Palande

unread,
Sep 11, 2014, 1:44:16 AM9/11/14
to erpnext-dev...@googlegroups.com
HI Rushabh,

Those file are already under `fx/fx/templates/pages`.
Should I have to move them under `frappe/frappe/templates/pages` ?

Thanks,


For more options, visit https://groups.google.com/d/optout.



--
S.S.Palande

Rushabh Mehta

unread,
Sep 11, 2014, 2:31:50 AM9/11/14
to erpnext-dev...@googlegroups.com
On 11-Sep-2014, at 11:14 am, Saurabh Palande <saura...@gmail.com> wrote:

HI Rushabh,

Those file are already under `fx/fx/templates/pages`.
Should I have to move them under `frappe/frappe/templates/pages` ?

No it should work as it is.

There was a bug with clearing cache in case of new pages. It is fixed in Frappe 5.0 

As a temp solution - clear your memcache to make your page appear.

Saurabh Palande

unread,
Sep 12, 2014, 4:18:24 AM9/12/14
to erpnext-dev...@googlegroups.com
Hi Rushabh,

Thank You.




For more options, visit https://groups.google.com/d/optout.



--
S.S.Palande

Saurabh Palande

unread,
Sep 12, 2014, 6:15:05 AM9/12/14
to erpnext-dev...@googlegroups.com
Hi Rushabh,

I have used `echo "flush_all" | nc 127.0.0.1 11211` command to clear memcache, it works for me, but is it a correct way or frappe have any built in command for this.

Regards,
--
S.S.Palande

Pratik Vyas

unread,
Sep 12, 2014, 11:50:50 AM9/12/14
to erpnext-dev...@googlegroups.com

Pratik Vyas

unread,
Sep 12, 2014, 11:51:29 AM9/12/14
to erpnext-dev...@googlegroups.com
Sorry, it's
`bench frappe --flush_memcache`
--
Pratik
erpnext
Reply all
Reply to author
Forward
0 new messages