Bootstrap modal window is not shown

For Joomla! 3.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
mostafa272
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Fri Feb 22, 2013 11:56 am

Bootstrap modal window is not shown

Postby mostafa272 » Thu May 10, 2018 9:02 am

Hi

I am creating a new module and I want to show some details in a modal window when user clicks on the link.
I used following code (in Joomla 3.7) but I don't know why modal window is not shown. Is there a conflict between bootstrap modal and jquery or mootools modal?



Code: Select all


$k=0;

 $modal_params = array();
 foreach ($selectboxs as $selectbox) :

    $modal_params['height'] = "400px";
    $modal_params['width'] = "300px";
   $modal_params['title'] = $selectbox->title;

   $body ='<div><img src="'.$selectbox->image.'" alt="'.$selectbox->title.'" title="'.$selectbox->title.'" />
   <p>'.$selectbox->description.'</p></div>';

echo '<a href="#annoncemodal-'.$k.'" class="btn" data-toggle="modal" >'.$selectbox->title.'</a>';
 echo JHTML::_('bootstrap.renderModal','annoncemodal-'.$k,$modal_params, $body);
$k++;

 endforeach;


User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 24513
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: Bootstrap modal window is not shown

Postby Per Yngve Berg » Thu May 10, 2018 9:41 am

Does your template use Bootstrap 2.3.2?

Try with Protostar.

https://getbootstrap.com/2.3.2/scaffolding.html

Some templates loads a newer version of Bootstrap, which s not compatible.


Return to “Joomla! 3.x Coding”

Who is online

Users browsing this forum: No registered users and 2 guests