Dynamic ID?

  • This topic has 3 replies, 2 voices, and was last updated 6 months ago by J. Davis.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1556638
    Thomas Levack
    Participant

    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
    T

    #1559707
    J. Davis
    Keymaster

    Hi 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/rHKUZupwkqTX

    #1561985
    Thomas Levack
    Participant

    Thank 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.

    #1562979
    J. Davis
    Keymaster

    Hi 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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.