Hello,
I have some issues with Lightbox plugin
the plugin loads Colorbox javascript (not the one released with Piwigo tough) and CSS files
no problem here
now I've two plugins using Colobox : oAuth and User Collections, as I don't mind offering the choice of a theme I load files from Piwigo core (style2 CSS)
there is no problem with the javascript as they have the same internal id and only load once by the template class, but the two CSS files are loaded, causing serious display issues
I though it would be simple to detect but it is not
things to know :
- oAuth load Colobox in the menubar
- Lightbox is applied on "loc_end_index_thumbnails" trigger
it is not as simple as knowing if Lightbox plugin is activated as it only applies when there are thumbnails on the current page
any ideas ?
Offline
add_event_handler('loc_end_index_thumbnails', 'uc_anti_lightbox', 41); function uc_anti_lightbox($tpl_thumbnails_var) { global $template, $page; if ($page['section'] == 'collections') { foreach ($template->css_by_priority[0] as $file) { if (strpos($file[0], 'colorbox.css') !== false) { $template->assign('UC_NO_LIGHTBOX', true); break; } } } return $tpl_thumbnails_var; }
{if not isset($UC_NO_LIGHTBOX)} {combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'} {combine_css path='themes/default/js/plugins/colorbox/style2/colorbox.css'} {/if}
but must think about a better way to do it, perhaps introduce ids for css files like we have for js files
Offline
mistic100 wrote:
but must think about a better way to do it, perhaps introduce ids for css files like we have for js files
Good idea!
Offline