klox7 VIP
Total posts: 914
21 Jan 2014 12:51

I would like to show map in modal window in list view. In record I have this:

<?php if(isset($item->fields_by_id[ID])): ?>

    <a href="#field-rslt-ID" data-toggle="modal">Show map</a>

    <div id="<?php echo 'field-rslt-'.$item->fields_by_id[ID]->id; ?>" class="<?php echo $item->fields_by_id[ID]->params->get('core.field_class');?><?php echo ($item->fields_by_id[ID]->params->get('core.label_break') > 1 ? ' line-brk' : NULL) ?> modal hide fade" tabindex="-1" role="dialog">

        <div class="modal-header">

            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

            <h3 id="myModalLabel"><?php echo $item->title?> Map</h3>

         </div>

         <div class="modal-body">

            <p><?php echo $item->fields_by_id[ID]->result; ?></p>

         </div>

         <div class="modal-footer">

            <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>

         </div>

    </div>

<?php endif; ?>

But for list view this doesn't work. The problem is it show only the same map in all listings (including title). Does anyone has any suggestions?

Last Modified: 02 Mar 2014


Sergey
Total posts: 13,748
22 Jan 2014 05:27

DO you have online link to see?

There may be problem that initially this map is hidden. You will need to trigger map event resize.


klox7 VIP
Total posts: 914
22 Jan 2014 06:22

Yes, here is the link...is it possible that I have to do foreach?

Hidden text


Sergey
Total posts: 13,748
22 Jan 2014 07:15

I see. This is problem of Bootstarp modal I believe. Try lightbox. Cobalt includes it. You only need to add to your template

JHtml::_('lightbox.init');

And then you can use lightbox syntax.

Powered by Cobalt