Rattie
February 17, 2023, 8:04am
1
No matter how I try, I can’t get this to trigger.
I have followed the instructions and searched the forum for answers, but there’s no explanation on how to do it. Lots of people asking, but no solution. I emailed the creator but got nothing back, and considering he took my money, this is disappointing. I can generally figure these things out - eventually, but this one has defeated me.
Is your project set to Bootstrap 5?
Rattie
February 17, 2023, 8:11am
4
I running the latest version of Blocs, so I presume so.
Maybe start by double checking that first. It’s in a project settings.
Rattie
February 17, 2023, 8:14am
6
It is.
I think the problem is here
Next, add the following 2 data-attributes to your button or link.
data-bs-target=“#your-modal-id ”
data-bs-toggle=“modal”
Desipte trying several times I can’t get them to stick.
Those attributes are correct.
Care to screen shot how you have added it.
Rattie
February 17, 2023, 8:18am
8
I know they are correct, but when I enter them and save that is the last I see of them. Give me a couple of mins and I will send a screenshot
1 Like
Eldar
February 17, 2023, 8:29am
10
data-bs-target should go into the Name field, while #your-modal-id should go into value.
As I suspected, the way you enter it is important, as above.
Also don’t forget to change the value to match the name of your modal, but keep the #
Rattie
February 17, 2023, 8:43am
12
Thank you, I understand now, but why don’t the instructions say that?
Usually attributes and values are written like that, because it’s how you would add it to the markup.
data-bs-target="#modal-id"
Blocs Custom Attribute separates them into input fields.
Attribute Name
data-bs-target
Value
#modal-ID
I can’t comment on the Bric instructions, I have never seen them. I do have the Bric though.
Rattie
February 17, 2023, 9:03am
14
I’m sure that there is a good reason that hooking up this bric has to be so complicated. The built-in one is limited but works like a dream, and for newbies like me is easy to make work.
Forgive the rant, but people who have a vast knowledge of such things often forget how difficult it is for people like me with no talent for such things to understand.
Anyway, thank you both for the help. It’s still not working, but I will get there. Trial & error.
1 Like
The ID of the modal and the ID in the data-bs-target have to be the same
What you set here is the ID
So in this example…
Attribute Name
data-bs-target
Value
#on-sale
And then you add another attribute
Attribute Name
data-bs-toggle
Value
modal
Rattie
February 17, 2023, 9:25am
16
We got there. Thank you, but boy was that a struggle.
1 Like
Just a way of thinking. You get used to it over time.
Obviously the built in Modal has an advantage over Brics. When we make them, we have to work within the API. But thats getting better.
I’ll make a button that opens the modals. It’ll have style options and global swatch support. …and will be free for owners of Modal Designer.
5 Likes
Recce43
February 17, 2023, 3:16pm
19
That’s awesome!! Great idea thank you!
Rattie
February 17, 2023, 3:32pm
20
That would have saved me hours trying to work it out. Great idea. Thank You.