We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24935
    • 160 Posts
    I finally got around to adding SmoothGalley as a plugin for the Gallery package (for Revolution). At this point, use it at your own risk. However, it appears to be working well. So now I can move some of those Evolution sites using MaxiGallery to Revolution!

    How to Install:
    1) Install the Gallery 1.0.2-rc2 addon
    2) Create a gallery, add some pictures, and try out the Gallery snippet to make sure everything is working.
    3) Unzip the attached file in the base directory of your MODx Revo install.
    WARNING - the zip file will overwrite core/components/gallery/model/gallery/plugins/galleryplugin.class.php (there is a bug in the original file that I had to fix)
    4) Try some of the examples below.

    (Note: SmoothGallery uses MooTools, so if you are using another JS library on the page, you will need to adjust things to avoid conflicts. If you are using jQuery, see this page: http://docs.jquery.com/Using_jQuery_with_Other_Libraries)

    Example Usage
    (Use only one on any page. Multiple smoothgalleries on the same page are not supported.)

    Basic:
    [[!Gallery? &album=`name_of_your_album` &plugin=`SmoothGallery`]]

    For nice cropping you should usually set &imageZoomCrop=`C` (which means centered)
    [[!Gallery? &album=`name_of_your_album` &plugin=`SmoothGallery` &imageZoomCrop=`C`]]

    Change the size:
    [[!Gallery? &album=`name_of_your_album` &plugin=`SmoothGallery` &imageZoomCrop=`C` &sgImageWidth=`500` &sgImageHeight=`400`]]

    Different Transition:
    [[!Gallery? &album=`name_of_your_album` &plugin=`SmoothGallery` &imageZoomCrop=`C` &defaultTransition=`fadeslideleft`]]

    Timed Rotation, custom delay, with arrows hidden:
    [[!Gallery? &album=`name_of_your_album` &plugin=`SmoothGallery` &imageZoomCrop=`C` &timed=`true` &delay=`6000` &showArrows=`false`]]

    Hide the Carousel and infopane
    [[!Gallery? &album=`name_of_your_album` &plugin=`SmoothGallery` &imageZoomCrop=`C` &showCarousel=`false` &showInfopane=`false`]]

    ReMooz (nice zoom in effect)--uses thumbnails for the main gallery and the larger image for the zoom. Notice the custom item template.
    [[!Gallery? &album=`name_of_your_album` &plugin=`SmoothGallery` &useReMooz=`true` &showCarousel=`false` &embedLinks=`false` &sgItemTpl=`SmoothGalleryReMoozItem` &sgThumbWidth=`300` &sgThumbHeight=`200` &sgImageWidth=`600` &sgImageHeight=`600` &imageZoomCrop=`C`]]

    General settings for the Gallery snippet
    See http://rtfm.modx.com/display/ADDON/Gallery.Gallery

    Plugin-specific settings
    &sgImageWidth=`460` (overrides &imageWidth)
    &sgImageHeight=`345` (overrides &imageHeight)
    &sgThumbWidth=`100` (overrides &thumbWidth)
    &sgThumbHeight=`75` (overrides &thumbHeight)
    &sgItemTpl=`SmoothGalleryItem` (overrides &thumbTpl)
    &sgContainerTpl=`SmoothGallery` (overrides &containerTpl)
    &sgJsTpl=`SmoothGalleryJS`
    &sgCssTpl=`SmoothGalleryCSS`
    &insertJs=`true`
    (the template chunks can be found in core/components/gallery/elements/chunks and there is no need to copy them into the the manager)

    SmoothGallery settings
    &showArrows=`true`
    &showCarousel=`true`
    &showInfopane=`true`
    &embedLinks=`true`
    &fadeDuration=`500`
    &timed=`false`
    &delay=`9000`
    &preloader=`true`
    &preloaderImage=`true`
    &preloaderErrorImage=`true`
    /* Data retrieval */
    &manualData=`{}` (Should set to an array, in JSON? format. Untested.)
    &populateFrom=`false`
    &populateData=`true`
    &destroyAfterPopulate=`true`
    &elementSelector=`div.imageElement`
    &titleSelector=`h3`
    &subtitleSelector=`p`
    &linkSelector=`a.open`
    &imageSelector=`img.full`
    &thumbnailSelector=`img.thumbnail`
    &defaultTransition=`fade` (other options: fadeslideleft, continuoushorizontal, continuousvertical. For option other than fade set &timed=`false`)
    /* InfoPane options */
    &slideInfoZoneOpacity=`0.7`
    &slideInfoZoneSlide=`true`
    /* Carousel options */
    &carouselMinimizedOpacity=`0.4`
    &carouselMinimizedHeight=`20`
    &carouselMaximizedOpacity=`0.9`
    &thumbHeight (use &sgThumbHeight instead)
    &thumbWidth (use &sgThumbWidth instead)
    &thumbSpacing=`10`
    &thumbIdleOpacity=`0.2`
    &textShowCarousel=`Pictures` (can be localized using the lexicon)
    &showCarouselLabel=`true`
    &thumbCloseCarousel=`true`
    &useThumbGenerator=`false`
    &thumbGenerator=`resizer.php` (hmm, I deleted this file...)
    &useExternalCarousel=`false`
    &carouselElement=`false`
    &carouselHorizontal=`true`
    &activateCarouselScroller=`true`
    &carouselPreloader=`true`
    &textPreloadingCarousel=`Loading...` (can be localized using the lexicon)
    /* CSS Classes */
    &baseClass=`jdGallery`
    &withArrowsClass=`withArrows`
    /* Plugins: HistoryManager */
    &useHistoryManager=`false`
    &customHistoryKey=`false`
    /* Plugins: ReMooz */
    &useReMooz=`false` (you should probably read the code if you are using this--it changes how some things are done)

    Please Help!
    Can volunteers please step up for these tasks:
    1) Test!
    2) Submit bug report for core/components/gallery/model/gallery/plugins/galleryplugin.class.php. The toBoolean method converts ’false’ to true.
    3) Put this in GIT, fix errors reported in this topic, and send a pull request (I have signed a CLA already and SmoothGallery is GPLv3)

      • 5148
      • 1 Posts
      Wow, that was a close one! A week ago I looked into using SmoothGallery with Gallery and Revolution and thought I’d have to write a Gallery plugin. Then two days ago I was resigned to starting the process and decided to give one last search and here you are!

      I’ve got your beta all installed and up and running. Seems like a great implementation to me. The one thing missing from my perspective is support for SG gallery sets. Is this a function you might add down the road? I’ve already got gallery sets functioning with some dodgy hacking and am about to start tidying things up now that I’m done figuring out the lay of the land code-wise.

      Ultimately I see no major issues with my code augmentation, but I’d rather not have to worry about upgrade paths. I’m not sure I’m reliable enough to formally contribute, though I’d be willing since I need to make this work for myself anyways. I used to be quite good with oo php5 a couple of years ago but I’m a little out of practice. At the least I’ll certainly let you know what I run across as a user as I integrate this into my site.

      By the way, I’m a new member here because of your contribution, so thanks!

      Chri
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Welcome, Chri! Any contributions are more than welcome; if this self-taught granny can be useful then certainly you can. Don’t be shy, post your code. If it needs any work, there will be plenty of suggestions.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 11103
          • 5 Posts
          Hi Rfoster — Thanks for sharing your work on this. Maybe I'm blind, but I can't seem to find the attached zip file. Is it still here? And should I be sure that galleryplugin.class.php is NOT overwritten, or do you mean that I should back it up because it is necessary that it be overwritten for smoothgallery to work properly?

          3) Unzip the attached file in the base directory of your MODx Revo install.
          WARNING - the zip file will overwrite core/components/gallery/model/gallery/plugins/galleryplugin.class.php (there is a bug in the original file that I had to fix)
            • 39189
            • 1 Posts
            Hi rfoster,

            I too am really interested in your SmoothGallery plugin, however I don't see the attached zip file either. Is there any chance you could upload it or send it to me?

            Many thanks,

            Dave