I’m facing an issue in Frappe Builder. I’m creating a fully dynamic page for a hotel website, where I’m pulling data from a Doctype using data script.
The problem is that my website will have multiple hotels, but whenever I add a new hotel, all hotels are getting displayed on the same single page in the Builder beacause of repeater.
I want each newly created hotel (in the Hotel Doctype) to have its own separate page, instead of all hotels appearing on one page.
How can I achieve this?
Hi @Ashmit-Singh ,
- Create a
/hotels
page to display all hotels using the repeater.
- Link each hotel to its dedicated detail page using the route
/hotels/<hotel>
.
Use the following query in the data script to fetch hotel-specific details:
data.hotel= frappe.get_all("Hotel", fields=['*'], filters={'hotel_name': frappe.form_dict.hotel})
Note: Ensure hotel_name
is unique or use name
(the ID) to avoid conflicts.
Set Data Key as hotel
repeater block and use their attributes for detail data according to the use case.
Thanks,
Daizy Modi
1 Like