Try ERPNext Buy Support Partners Foundation

Frappe web page with params


I have one app having few doctypes. Also, in same app, I have created one web page that does not require login. So, I can access it from http://localhost:8080/home.

Now, I want home page with query string params e.g. http://localhost:8080/home/aaa OR http://localhost:8080/home/bbb where aaa & bbb are query string params. So, how can I specify the same and where? urls with params also land to home page only and then want to perform some action based on params.

Hello @grh if your url is like this http://localhost:8080/home?aaa=something&bbb=something_else
then in your .py file add like this–
def get_context(context):
query_params = frappe.request.environ.get(‘QUERY_STRING’)

Varialble query_params has everything you need now.
Please reply if it works

Or you can just use this-

“aaa” and “bbb” are query string params value. there will be only one param. also, issue is that I want nice urls, so http://localhost:8080/home/aaa should go to home page only. But , for now it is considering home/aaa as another page, and so gives “page missing or moved” error.

Hello all,

Can we have User friendly url and redirection rules in frappe? The way we do it in IIS web site, what is the option in frappe?

i.e. my het request for /home?key=455 should looks like /home/455/ and go to home page only.

Can anyone help into this?
Actually I want to make get request with parameter with nice url like /home/value1. i.e. it should map to home?p1=value1 where param 1 is value for parameter p1. I want it should land to home page only and javascript on page will extract params and do further as per my need.

But just now /home/value1 tries to find page “value1” considering home as directory. And so gives page is missing error.

I am trying to solve this from many days.

I have app with doctypes and one web page named home. I need this on web page. Then where to write this method?

Where did you create that home page? In www folder?

No created using web page inside website module