I am having difficulties using XML and XSLT. I want to have a few bits of information in a tile on a page, which then you can click on a more info button and a modal will popup with extra information on the person. However, currently all the modals show information about the first person in the list and am not sure how to sort this out.
Asked
Active
Viewed 81 times
1 Answers
1
It's probably because you have multiple modals, one for each person, with the same id; "myModal".
What you could try doing is changing the id of the modal to this....
<div class="modal fade" id="myModal{position()}" role="dialog">
And the button to this...
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal{position()}">More Info</button>
The curly braces here are Attribute Value Templates, which means the result of the expression will be evaluated and placed in the attributes. In other words, your modals will have the ids; "myModal1", "myModal2" etc, and so be unique.

Tim C
- 70,053
- 14
- 74
- 93
-
I just edtied my answer, as I realised I had put the AVT in the wrong attribute on the button.... – Tim C Apr 20 '18 at 21:53