- This topic has 3 replies, 2 voices, and was last updated 11 months ago by J. Davis.
- AuthorPosts
- January 13, 2024 at 8:40 pm #1556638Thomas LevackParticipant
I have built a custom accommodation single page in elementor theme builder. Run into an issue as the Availability Calendar and booking form widget are not set up to use a dynamic ID.
I am using a CPT for my content along side with motopress accommodation types.I have a meta field for the MP acc type ID. Is there any way/hack to make this widget work dynamically as they do on the template page?
Thanks
TJanuary 19, 2024 at 7:15 am #1559707J. DavisKeymasterHi Thomas,
You may install the latest versions of Elementor Integration add-on. You will find the widgets for attributes, calendar, form, gallery, etc. in the list of the Elementor widgets https://prnt.sc/AJ5XzmG8WhxK If you use a kind of template builder the IDs of accommodation types will be fetched automatically. If you create custom pages you will need to select the needed property from the list https://prnt.sc/rHKUZupwkqTXJanuary 24, 2024 at 12:25 pm #1561985Thomas LevackParticipantThank you for your response. I do have the latest version of the Elementor Integration add-ons installed. I need the booking form and the availability calendar which are not listed under accommodations widgets.
I am currently attempting to attach the data attribute via code, but not having any luck. I set class of widget to “availcal” and then using
document.querySelector(“.availcal”).setAttribute(“data-room-type-id”, “59”);
This is just a simple line I am using for testing. If I can make the widget see the ID this way, then I will easily be able to make the code work dynamically with the CPT. I have a meta field that will have the Motopress Accommodation Type ID.
I have a workaround for now, but I’m loading 7 instances of each widget and using dynamic visibility to turn them on and off. This works without adding too much weight to the page but being able to change the ID would be more efficient.
January 26, 2024 at 6:34 am #1562979J. DavisKeymasterHi Thomas,
I’m not experienced in JS but can guide you through the default plugin capabilities. You may check the screenshots I’ve shared in my previous reply and see that all the needed widgets are available in the Elementor editor and we advise you to use them to build a custom layout, template, etc. - AuthorPosts
- You must be logged in to reply to this topic.