We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28215
    • 4,149 Posts
    This is an auto-generated topic for Gallery 1.0.1-pl by splittingred.

    Brief Description:

    Gallery is a dynamic Gallery Extra for MODx Revolution. It allows you to quickly and easily put up galleries of images, sort them, tag them, and display them in a myriad of ways in the front-end of your site.
    New in 1.0.1

    • [#54] Added filepath placeholder for getting absolute path of an image, fileurl for absolute URL
    • [#12] Make left-click do update-album in mgr tree
    • Add additional system setting checks for phpthumb config options.
    • *Many* caching improvements to phpthumb-generated thumbnails
    • Added gallery.thumbs_prepend_site_url setting for environments having issues with thumbnails
    • Fixed bugs with HTML in item thumbs, urls when xhtml_urls is true
    • Added French translation

    New in 1.0.0

    • Added fix to prevent uploading of files with spaces in names, converts old files to non-space names
    • Now respects Revolution xhtml_urls setting for ampersands
    • Fixed ampersand issue in Gallery URLs
    • Fixed phpthumb cache issue by using core phpthumb
    • Fixed port issue on thumbs
    • Updated Russian translation
    • Added custom TV for adding Gallery Items straight onto a page via a TV
    • Added crop/resize/rotate support, plus more, to custom TV


    See the official documentation here:
    http://svn.modxcms.com/docs/display/ADDON/Gallery
      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
      • 17249 ☆ A M B ☆
      • 165 Posts
      Hi;
      I managed to implement the Gallery Add-on with some modifications to include the jquery Galleria.
      The process was relatively easy, congrats for the awesome work at this Add-On from the author.
      But even the gallery seems to be working good, i’m getting an Error in the Console:

      [2011-02-17 09:37:39] (ERROR @ /index.php) Instantiated a derived class galItem that is not a subclass of the requested class galAlbumItem
      


      I have 3 galleries up and running, and the error seems to be showing once for each gallery every time i hit the listings page.
      This tells me im using some not loaded class in the code that generates the listing Items (each gallery Title, Thumbnail) since the error is showing 3 times in a row when i hit the page.

      Here’s the code in my resource:

      [[!GalleryAlbums@Galerias? &toPlaceholder=`galleries`]]
      [[!Gallery? &toPlaceholder=`gallery` &linkToImage=`1`]]
      [[!GalleryItem]]
      
      [[!+gallery:is=``:then=`
      <div class="galeria_ct">
      <div class="ct_fotos">
      <ul>
      [[+galleries]]
      </ul>
      </div>
      </div>
      `:else=`
      <div id="galleria">[[+gallery]]</div>
      <script type="text/javascript">
      Galleria.loadTheme('/js/gallery/src/themes/classic/galleria.classic.js');
      $('#galleria').galleria({height:500, debug:false});
      </script>
      `]]
      



      I’ve used the examples in the Documentation and extended from there to adjust to my needs.
      Also updated galAlbumRowWithCoverTpl to fit the html structure i needed.

      <li>
          <a href="[[~[[*id]]? &[[+albumRequestVar]]=`[[+id]]`]]" title="[[+name]]">
              <img width="100" height="100" src="[[+image]]" alt="[[+name]]" />
              <span>[[+name]]</span>
          </a>
      </li>
      



      What do you think im doing wrong to get this error?
      (Note galleries are working good).
        • 3866 ☆ A M B ☆
        • 350 Posts
        I too have received that error message with a gallery I’m running

        [2011-02-21 17:48:33] (ERROR @ /index.php) Instantiated a derived class galItem that is not a subclass of the requested class galAlbumItem

        My code is as follows:
        <p>Please click on one of the folders listed below to see more images, and then click on an individual image to enlarge.</p>
        [[!Gallery? &thumbWidth=`80` &thumbHeight=`80` &thumbTpl=`GalColorBoxItem` &toPlaceholder=`gallery`]]
        [[!GalleryItem]]
        <ul>
        [[!GalleryAlbums? &rowTpl=`METgalAlbumRow`]]
        </ul>
        <hr />
        [[!+gallery:notempty=`[[+gallery]]`]]

        The chunk is:

        <li class="albumList"><a href="[[~[[*id]]? &[[+albumRequestVar]]=`[[+id]]`]]">[[+name]]</a></li>

        Any suggestions folks? huh
          Helen Warner
          Number one pixel!
          Proud to be linked with MODX at Crimson Pixel
          • 17249 ☆ A M B ☆
          • 165 Posts
          Also, this was experienced by another Modx user, was filed recently in the issue tracker at Github.
          https://github.com/splittingred/Gallery/issues/#issue/66
            • 3866 ☆ A M B ☆
            • 350 Posts
            Cool, thanks for the heads up. Will await a fix!
              Helen Warner
              Number one pixel!
              Proud to be linked with MODX at Crimson Pixel
              • 18480
              • 9 Posts
              Have posted a fix to issue 66, copied here:

              I think there is a small bug in the GalleryAlbums snippet at line 86 (in 1.0.2rc2).
              The final line of this sequence:

              $c = $modx->newQuery(’galItem’);
              $c->innerJoin(’galAlbumItem’,’AlbumItems’);
              $c->where(array(
              ’AlbumItems.album’ => $album->get(’id’),
              ));
              $c->sortby($albumCoverSort,$albumCoverSortDir);
              $c->limit(1);
              $coverItem = $modx->getObject(’galAlbumItem’,$c);

              should read:
              $coverItem = $modx->getObject(’galItem’,$c);

              This ensures the getObject is being called for the primary class in the query. For some reason this error only showed up when I altered the caching spec on a top-level TV call (to non-caching), so I suspect under some circumstances xPDO manages to work out the correct class name.
                • 17249 ☆ A M B ☆
                • 165 Posts
                Changed the line and its working good now.
                No error is showing in the console, galleries are ok.
                Thanks a lot!
                  • 3866 ☆ A M B ☆
                  • 350 Posts
                  Well done, I’ve changed the code and the error log is empty when viewing the gallery. Cool! wink
                    Helen Warner
                    Number one pixel!
                    Proud to be linked with MODX at Crimson Pixel