Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Can I use the lightboxes in ImageGalleryModule on other pages within my site?

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1286 Views
  • zim
    Avatar
    Community Member
    135 Posts

    Can I use the lightboxes in ImageGalleryModule on other pages within my site? Link to this post

    I want to pop a youtube link into one of the cool lightboxes used by the ImageGalleryModule. From Another page on my site. My home page in fact

    I have link to the prettyphoto.js file in image_gallery/javascript/prettyphoto/prettyphoto.js

    and have used the code form prettyphoto web site to try and implemet lightbox

    http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/

    but i think there is some kind of jquery problem

    i drop the below into the page just before closing </body> tag as instructed and have also tried to change $ - $jQuery.

    <script type="text/javascript" charset="utf-8">
          $(document).ready(function(){
             $("a[rel^='prettyPhoto']").prettyPhoto();
          });
       </script>

    Does anyone know why this would not work I am definately linking to the prettyphoto.js file as put in an alert to test

  • zim
    Avatar
    Community Member
    135 Posts

    Re: Can I use the lightboxes in ImageGalleryModule on other pages within my site? Link to this post

    I have nearly got this working.

    I have included this in my HomePage.php

    public function init()
       {

          parent::init();
          self::prototype2jquery();
          self::includeForPrettyPhoto();
          

       }

       private static function prototype2jquery() {
          Requirements::block('jsparty/prototype.js');
          Requirements::javascript('jsparty/jquery/jquery.js');
          Requirements::javascript('jsparty/jquery/jquery.cycle.js');
       }
       
       private static function includeForPrettyPhoto()
       {
          Requirements::javascript('image_gallery/javascript/prettyphoto/jquery.prettyPhoto.js');
          Requirements::javascript('image_gallery/javascript/prettyphoto/prettyphoto_init.js');

          Requirements::css('image_gallery/css/prettyphoto/prettyPhoto.css');
       }

    and this link in my HomePage.ss

    <a href="http://www.youtube.com/watch?v=qqXi8WmQ_WM" id="http://www.youtube.com/watch?v=qqXi8WmQ_WM" rel="prettyPhoto" >Video Title</a>

    the prettyphoto box opens with the loading icon but nothing loads in??

    any idea why. I am so close.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Can I use the lightboxes in ImageGalleryModule on other pages within my site? Link to this post

    Are you sure that PrettyPhoto supports video? I think you probably want to direct your questions to the PrettyPhoto documentation, since this isn't really related to Silverstripe.

  • zim
    Avatar
    Community Member
    135 Posts

    Re: Can I use the lightboxes in ImageGalleryModule on other pages within my site? Link to this post

    I have managed to get this working.

    my problem was that in trying to use the image gallery version this does not support youtube links. basically had to get new version of prettyphoto and use files from this instead.

    so i blocked this one and loaded my own. now works fine!

    public function init()
       {

          parent::init();
          self::prototype2jquery();
          self::includeForPrettyPhoto();
          

       }

       private static function prototype2jquery() {
          Requirements::block('jsparty/prototype.js');
          Requirements::javascript('jsparty/jquery/jquery.js');

       }
       
       private static function includeForPrettyPhoto()
       {
          Requirements::block('image_gallery/javascript/prettyphoto/jquery.prettyPhoto.js');
          Requirements::javascript('jsparty/jquery/jquery.prettyPhoto.js');
          Requirements::javascript('image_gallery/javascript/prettyphoto/prettyphoto_init.js');

          Requirements::css('themes/tutorial/css/prettyPhoto.css');
       }

  • zim
    Avatar
    Community Member
    135 Posts

    Re: Can I use the lightboxes in ImageGalleryModule on other pages within my site? Link to this post

    sorry to go on about non silverstripe stuff. But it is the case that the new version of pretty photo supports youtube links, as well as flash and .mov etc and is pretty easy to integrate into silverstripe....

  • UncleCheese
    Avatar
    4085 Posts

    Re: Can I use the lightboxes in ImageGalleryModule on other pages within my site? Link to this post

    Looks like you're using a really old version of ImageGallery. All that includeForXXX() stuff is pretty old school. Glad it's working, though!

  • zim
    Avatar
    Community Member
    135 Posts

    Re: Can I use the lightboxes in ImageGalleryModule on other pages within my site? Link to this post

    oh! ok. I downloaded the imagegallery module only one week ago from the silverstripe site?

    Has it changed a lot? what are the benefits in the new version dude?

    1286 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.