7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Image Gallery JS components not loading on pages
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 2117 Views |
-
Image Gallery JS components not loading on pages

4 February 2010 at 12:39pm
I'm having an issue where the Image Gallery js files for the chosen lightbox, etc. are not getting appended to the generated pages. Clicking on an gallery thumb just opens the full-size version in a new window.
As a work around, I've placed calls to the necessary js files at the end of my page.ss template. This allows the lightbox function to work, but it's an undesirable workaround.
I've also noticed that js files from other modules, such as the Thickbox module, are not being called either. Am I missing somthing? I've placed the module folders in the site root, named them correctly, done a dev/build?flush=1 as per the instructions. Any help is very welcome.
Thanks,
PM -
Re: Image Gallery JS components not loading on pages

4 February 2010 at 1:23pm
Is the module in a directory named "image_gallery"? or is it another name? For the files to be found, you must name your module directory "image_gallery"
-
Re: Image Gallery JS components not loading on pages

5 February 2010 at 7:04am
Thanks for giving me some help:)
The module directory is indeed named "image_gallery". I made sure of that when this first happened.
Oddly, the gallery seems to work perfectly with the blackcandy template engaged, but not my new template. I've tried identifying the code difference between my template and the default one, but neither the main page.ss or layout page.ss have any differences, other than the layout structure.
I've noticed that in the generated code, the script calls show up between the last </div> and </body>. What's the mechanism for calling them there, that I don't see in the template .ss files?
The fact that the Image Gallery module works fine with the default template indicates that the installation is fine. I know I'm missing something in my template, but i don't know enough about how the js files get called to identify what it is.
-
Re: Image Gallery JS components not loading on pages

5 February 2010 at 8:02am
Send me a link and I'll take a look.
The asset requirements are handled by the Requirements class.
-
Re: Image Gallery JS components not loading on pages

5 February 2010 at 9:45am Last edited: 5 February 2010 9:46am
Here's a link to the gallery:
http://www.hiphient.com/photos/
To get the gallery working, I pasted the following four lines of code into my page.ss file at the end:
<script src="/image_gallery/javascript/imagegallery_init.js?m=1251465430" type="text/javascript"></script>
<script src="/image_gallery/gallery_ui/fancybox/javascript/jquery.fancybox-1.0.0.js?m=1251465396" type="text/javascript"></script>
<script src="/image_gallery/gallery_ui/fancybox/javascript/jquery.pngFix.pack.js?m=1251465401" type="text/javascript"></script>
<script src="/image_gallery/gallery_ui/fancybox/javascript/fancybox_init.js?m=1252375526" type="text/javascript"></script>Thanks for taking a look.
-
Re: Image Gallery JS components not loading on pages

3 May 2010 at 1:54pm Last edited: 4 May 2010 3:40pm
I see your problem is fixed which is cool. I have a problem which is relating to this, I would like to know where in the imag_gallery PHP does it
the javascript plugin that I pointed to use in the CMSRequirements::javascript...
... ok it was a stupid question, finally found it in gallery_ui/shadow/code
-
Re: Image Gallery JS components not loading on pages

26 September 2010 at 10:23pm Last edited: 26 September 2010 10:24pm
I have installed SS version 2.4.2, and I was having trouble showing my image gallery in the front page because jquery and prototype weren't loading correctly, so I changed these two lines in image_gallery/code/ImageGalleryPage.php (function starts at line 247):
private static function prototype2jquery() {
//Requirements::block('jsparty/prototype.js');
Requirements::block('sapphire/thirdparty/prototype/prototype.js');//Requirements::javascript('jsparty/jquery/jquery.js');
Requirements::javascript('sapphire/thirdparty/jquery/jquery.js');
}Hope that helps someone.
-
Re: Image Gallery JS components not loading on pages

27 September 2010 at 1:52am
That function hasn't existed in a long time. Where did you get this from? Line 247 of ImageGalleryPage.php is this:
protected function Items($limit = null) {
if($limit === null && $this->MediaPerPage ) {
if( !isset($_REQUEST['start']) || ! is_numeric( $_REQUEST['start'] ) )
$_REQUEST['start'] = 0;
$limit = $_REQUEST['start'] . "," . $this->MediaPerPage;
}---------------
Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com
| 2117 Views | ||
| Go to Top | Next > |


