We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34120
    • 236 Posts
    This maybe answered with an explanation of some MODx fundamentals.

    I've built a gallery which is working intermittently, when I click on an album link sometimes the images load and sometimes they don't. I've a feeling this is because the slideshow js is running before the gallery info has finishing loading into the placeholder.

    Here's how I'm doing things:
    // Gallery call
    [[!Gallery? 
        &thumbTpl=`galleryThumb`
        &toPlaceholder=`gallery`
    ]]
    
    // galleryThumb chunk
    {image : '[[+image]]', title : '[[+name]]', thumb : '[[+thumbnail]]'},
    Then my placeholder is inside a javascript function.
    It also calls a small "rtrim" snippet to remove the last comma from the last row.
    // The JS - I've cut most of it out 
    <script type="text/javascript">			
    	jQuery(function($){
    		$.supersized({
    			slides:[  
    				[[+gallery:rtrim]]	
    			]
    		});
    	});    
    </script>

    So i'm wondering if order of excution is getting messed up somewhere. Do you think I'm on the right track?

    Many thanks in advance

    MODX Revolution 2.1.5-pl
      • 34120
      • 236 Posts
      Hmm, the plot thickens, this only seems to happen in Chrome. Firefox and IE appear to be working fine.
        • 22303 MODX Staff
        • 10,725 Posts
        All PHP execution is completed before the page content even begins execution of any Javascript on the generated page. This would not be the cause. It is likely all Javascript related if the page content is rendering properly and is behaving differently in different browsers.

        Also, make sure it's not related to you being logged in with a manager account in the browser that works.
          • 34120
          • 236 Posts
          Quote from: opengeek at Dec 15, 2011, 11:52 AM
          Also, make sure it's not related to you being logged in with a manager account in the browser that works.

          !! I was logged into manager with Chrome, logged out and all seems to be working now.
          Massive thanks opengeek.

          Fingers crossed that's all the tough stuff out of the way now.