We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25876
    • 79 Posts
    Hello,

    this is pretty much what I'm trying to do:
    http://forums.modx.com/index.php?topic=35806.0
    But, well, just with Gallery, not MaxiGallery.

    So everything works perfect, I do have the thumbs and the gallery pictures at the very same page. Here's how it looks like:
    http://planungsbuero-ried.at/modx/index.php?id=7

    But all I want to do is to pre-load the first (or indeed, any) of the small images so that when you click on the link to the page, you won't find a blank space insead of the first image. Simply initiate one of the images without having to click on a thumb first.
    (I think this should be pretty straight-forward, but I just can't find anything pointing me into the right direction; isn't there just a simple parameter to solve this?)

    Here's the call:
    <table style="width: 950px;" border="0">
    <tr>
    
    <td rowspan="2" style="width: 600px;">
    
    [[!GalleryItem]]
    [[!+galitem.image:notempty=`
    <div class="image">
    
    <img class="[[+galitem.imgCls]]" src="[[+galitem.image]]" alt="[[+galitem.name]]" />
    
    </div>
    `]]
    
    </td>
    
    
    <td style="margin-left: 350px; padding: 5px;" valign="top">
    <h2>[[*pagetitle]]</h2>
    <p>
      <span>[[*longtitle]]</span><br />
      <span>[[*description]]</span></p>
    <p><br />
      <span>[[*introtext]]</span></p></td>
    
    <tr>
      <td style="margin-left: 350px; padding: 5px;" valign="bottom">
      
      [[!Gallery? &album=`1` &toPlaceholder=`gallery`]]
    <!-- <h1><a href="[[~[[*id]] &galAlbum=`[[+gallery.id]]`]]">[[+gallery.name]]</a></h1>
    <p>[[+gallery.description]]</p>-->
     
    [[+gallery]]
      
      
      </td>
    
    </tr>
    </table>


    Thanks for any help guys!
    Simon
      • 25876
      • 79 Posts
      sorry to post again, but does really nobody know a solution to this problem?

      kinda urgent on this end, this issue is the last thing that keeps the site from going online ...
        • 3749
        • 24,544 Posts
        There is a JS solution:

        <SCRIPT language="JavaScript">
            <!--
              preload_image = new Image(25,25); 
              preload_image.src="http://mydomain.com/image.gif"; 
            //-->
            </SCRIPT>


        And a non JS solution:

        in your CSS file:

        div#preload { display: none; }


        At the bottom of the page:

        <div id="preload">
           <img src="http://domain.tld/image-01.png" width="1" height="1" alt="Image 01" />
           <img src="http://domain.tld/image-02.png" width="1" height="1" alt="Image 02" />
           <img src="http://domain.tld/image-03.png" width="1" height="1" alt="Image 03" />
        </div>
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 37451
          • 8 Posts
          Have you found a solution for displaying the first item of the album? I'm having the same problem and can only display one photo by entering the exact ID. with the code:

          [[!GalleryItem? &id=`1`]]


            • 39044
            • 10 Posts
            same here. was wondering if it could write the id dynamic by reading the current album and returning the id of the first image. that would make-it cover image.
            I'm not good yet with php coding so i can't yet design the code for-it, but i believe it should be possible
              • 36426
              • 197 Posts
              Hi this solution works:
              http://forums.modx.com/thread/98144/snippet-not-working-right-all-the-time#dis-post-530695

              But I'm having problems with Gallery item IDs over 100, for some reason it stops pulling in the first image when it gets over 100, can anyone help fix this at all?
                Yorkshire UK based hosting provider: https://www.simulant.uk