- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
Joomla 2.5 Troubleshooter. Lightboxes do not work after updating K2/Joomla engine
March 30, 2015
This tutorial shows how to solve issues with lightboxes after updating Joomla 2.5.x engine and K2 component.
Joomla 2.5 Troubleshooter. Lightboxes do not work after updating K2/Joomla engine
-
Let’s open Portfolio page. Click on the image:
-
We can see that lightbox does not work:
-
Open Firebug and inspect code for this image. We can see the code class="modal":
-
Open the folder with the template and make sure that you have unzipped fullpackage. We should search code class="modal" in files inside templates\themeXXXX\html folder and subfolders (XXXX are actual theme numbers):
-
Open editor that allows searching text/code in multiple files. We are using Notepad++ software.
Press Ctrl+F in order to open search dialog, go to Find in Files tab. Search text using class="modal" keyword. Select path to templates\themeXXXX\html files, make sure that you have the same options in search dialog and click Find All button:
-
We can see the list of files where class="modal" is being used. You may perform changes in all files listed in search results. In this case lightbox issue will be solved for all modules and components:.
-
In our case we should look for files for portfolio page template. In our case the following files should be modified:
- templates\themeXXX\html\com_k2\templates\portfolio\category.php
- templates\themeXXX\html\com_k2\templates\portfolio\category_item.php
- templates\themeXXX\html\com_k2\templates\portfolio\item.php
-
Open the appropriate file, go to beginning of this file. Add the following code below tag:
JHtml::_('behavior.modal', 'a.modal');
Save changes you have performed to file and upload the modified file:
-
Refresh your site and clear your browser cache. We have solved the issue with lightbox:
-
Issues with lightboxes on other sections/modules can be solved in the same way. For example, in our case lightboxes do not work in jcarousel module on home page:
-
We should find the appropriate file in themeXXX\html folder. In our case this is templates\themeXXX\html\mod_k2_content\jcarousel\default.php file. Add the following code below tag:
JHtml::_('behavior.modal', 'a.modal');
-
Refresh your site and clear your browser cache. We have solved the issue with lightbox in jcarousel module:
Feel free to check the detailed video tutorial below:
Joomla 2.5 Troubleshooter. Lightboxes do not work after updating K2/Joomla engine