Search the Community
Showing results for tags 'thumbnails module'.
-
Just discovered something weird with the Thumbnails module http://modules.processwire.com/modules/fieldtype-crop-image/ I'm using PW 2.3.2, Thumbnails module v1.0.3 Basically, I have this code in my template: <img src="<?php echo $page->thumbnail->getThumb('department-thumb'); ?>" > and in my <head> I have this code: <?php foreach($config->scripts as $file) echo '<script src="'.$file.'"></script>'; ?> I populate $config->scripts by doing the following in my init.php file: $scripts = array( 'modernizr' => $url.'modernizr.js' ,'jquery' => $url.'jquery.js' ,'masonry' => $url.'jquery.masonry.min.js' ,'fancybox' => $url.'jquery.fancybox.js' //,'bootstrap' => $url.'bootstrap.js' //,'main-js' => $url.'main.js' ,'responsive-slides' => $url.'responsiveslides.min.js' ,'main' => $url.'script.js' ,'placeholder' => $url.'placeholderfix.js' ); foreach($scripts as $key => $file) $config->scripts->add($file); Actually, you can recreate the issue without populating $config->scripts with your custom scripts just as long as jQuery Fancybox Plugin is activated. To recreate the issue, use this inside your template: <?php $output = '<img src="' . $page->thumbnail->getThumb('thumbnail') . '"> ?><!doctype html> <head> <?php foreach($config->scripts as $file) echo '<script src="'.$file.'"></script>'; ?> </head> <body> <?php echo $output; ?> </body> </html> In your <head> you should see something along the lines of: <script src="/wire/modules/Jquery/JqueryFancybox/JqueryFancybox.js?v=126"></script> Which we don't want loading in there. But, if you do the "getThumb()" call inside the <body>, meaning you do it after the scripts/css has been loaded, then JqueryFancybox of course won't be loaded.