Trigger a popup from the button on Classic card

Hello,

I trigger a popup to schedule appointment using Timify. I can trigger it with a button using the following code:

<button class="timify-button x-btn blue-btn mtl x-btn-global x-btn-block" data-id="5b8a7e519902fc501864e9fb">Prendre rendez-vous</button>

`

On the Classic Card Element, there is a possibility to add a button on the back side. I am using it on 4th section of the homepage of my website.

How could I trigger the popup from the button on the back side of the card?

Thanks for your help,
Antoine

Hey Antoine,

Regretfuly, you could not add a class and custom attribute to the card button so you’ll need to disable the back button and add your button HTML in the back content.

Hope that helps.

Thank you for the explanation.

I followed your instruction and the button looks fine. Unfortunately, it doesn’t trigger the popup though. Any idea what might be causing the problem?

The script is in the topbar (so that it works for all the similar buttons on every page):

The code of the button is on the back of the card:
<button class="timify-button x-btn mtl x-btn-global" data-id="5b8a7e519902fc501864e9fb">Prendre rendez-vous</button>

PS: the closing </script tag is missing in my message as it is somehow automatically removed.

Hello There,

Thanks for updating in! The button should have work as what have Christian instructed. I have inspected the page and it is not working because there is a JS error on the page. It is coming from the Timify script itself. Please check out this screenshot:

This error could be because the button does not have any ID in it. Using a button code with the ID in it can only be used once since an ID must be unique. You cannot use ID of an element twice or more in the same page.

Hope this helps.

Thanks for looking into this. I am not sure I understand it right though.

I have several button using the same code on other pages and it works just fine (the script is only used in the topbar, so that it works for all buttons of the website).

I have no idea about ID as I do not use any ID is any other button, even if there is this “data-id=“5b8a7e519902fc501864e9fb”” which is necessary to call my agenda from Timify.

Hello There,

Your code has been accepted inside the card element. Regretfully the data-id=... attribute of your code was stripped because the card content only allows basic html codes in it.

This means that your custom button code will not work when placed inside the card element. You cannot trigger your Timify using the back cover button in the card element.

Hope this explains it briefly.

Thank you for the explanation. I guess I will then have to use another element :slight_smile:

You’re welcome, @Lecoqdigital. I’m sorry I didn’t realized that the data attribute was stripped. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.