0

Ok here is the tag:

{exp:channel:entries dynamic="no"}
    {download_listing  sort="desc"}
          <ul>
            <p>
              <button data-toggle="modal" href="#myModal" class="btn-small pull-left" onclick="location.href='#';">{title} </button>
            </p>
            <div class="modal" id="myModal">
              <div class="modal-dialog">
                <div class="modal-content">
                  <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title">{row_id} {row_count} of {total_rows}: {title} </h4>
                  </div>
                  <div class="modal-body"> <img src="{listing_image}" alt="" class="pull-left">
                    <p>{row_id} {listing_describtion} </p>
                  </div>
                  <div class="modal-footer"> <a href="#" data-dismiss="modal" class="btn">Close</a> <a href="{listing_doc}" target=“_blank” class="btn btn-primary">Download PDF</a> </div>
                </div>
              </div>
            </div>
          </ul>
    {/download_listing}
{/exp:channel:entries} 

and here is the link:

http://boardmans.happytesting.co.uk/download

Sa you can see i am getting the name on each buttons correct but when you click on each button the data inside; i mean the second title; listing_image and listing_describtion tags are being repeated. Could anyone help here because it doesn't make any sense for me any more.. Thank you Regards

  • 2
    Check your markup. You are using <ul> elements but they have no <li> elements inside. Then prefix each column name with download_listing. For example {download_listing:listing_image} – foamcow Sep 29 '14 at 11:13
2

I think the problem isn't with Matrix but to do with your IDs. Your hrefs are all linking to #myModal, which in itself isn't an issue, however you have 4 divs with an ID of myModal so it is always linking to the first instance. Try adding the row_id to the end of these IDs, both the div ID and button href, I think this should sort you out.

  • Exactly what I was going to suggest! – Mark Busnelli Jr Sep 29 '14 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.