[Answer]-Proper link not working in django

1đź‘Ť

âś…

You can have only one element with a given ID (modal1 in your case). All of your “Take a look” links open the first element with the modal1 ID, because the rest of the elements’ IDs are disregarded. You need to render unique IDs for each project, e.g.:

...
<a data-toggle="modal" href="#modal{{ project.pk }}" class="btn btn-primary btn-lg">Take a Look</a>
...
<div class="modal fade" id="modal{{ project.pk }}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
...
👤lanzz

Leave a comment