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

    I seemed to have hit a wall. I hope that there is somewhere out there listening that can slap me back in the right direction! grin My basic objective is to move the site http://www.villarivieradelfiori.co.uk/ to modx cms, the basic scrolling images on the front page are generated from a folder on the server using the following code:

    <head>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/jquery.cross-slide.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){loadImage();})

    function loadImage(){
    // getimage.php is the php file that gets my images from the images folder
    $.post("getimage.php", function(data){
    if(data.length >0) {
    // evaluate the string to a group of objects
    myObject = eval(data);
    // create a slideshow with the image objects and drop them in the placeholder
    $(’#imgcontainer’).crossSlide({sleep:5,fade:2},myObject);
    }
    });

    }
    </script>
    <head>

    <body>
    <div id="imgcontainer">
    <img src="img/ajax-loader.gif" style="margin-top:20%" alt="loading…" id="mainImg" />
    </div>
    </body>

    Now I know that there are other addons to modx out there such as Maxigallery which I just seem to have endless trouble with :’(, all I need to do is create this simple scrolling image on the front page so I do not feel I am re-creating the wheel as the simplicity required here must be possible!? I know it can be done I am probably just missing something really simple!

    I know that the php file is doing its job as firebug gives me this output:

    [{’src’:’C:\xampp\xampp\htdocs\villa\assets\images\imagefolder/villa015.jpg’},{’src’:’C:\xampp\xampp\htdocs\villa\assets\images\imagefolder/villa014.jpg’},{’src’:’C:\xampp\xampp\htdocs\villa\assets\images\imagefolder/villa002.jpg’},{’src’:’C:\xampp\xampp\htdocs\villa\assets\images\imagefolder/villa013.jpg’},{’src’:’C:\xampp\xampp\htdocs\villa\assets\images\imagefolder/villa010.jpg’},{’src’:’C:\xampp\xampp\htdocs\villa\assets\images\imagefolder/villa006.jpg’},{’src’:’C:\xampp\xampp\htdocs\villa\assets\images\imagefolder/villa009.jpg’},{’src’:’C:\xampp\xampp\htdocs\villa\assets\images\imagefolder/villa005.jpg’},{’src’:’C:\xampp\xampp\htdocs\villa\assets\images\imagefolder/villa011.jpg’},{’src’:’C:\xampp\xampp\htdocs\villa\assets\images\imagefolder/villa001.jpg’},{’src’:’C:\xampp\xampp\htdocs\villa\assets\images\imagefolder/villa004.jpg’},{’src’:’C:\xampp\xampp\htdocs\villa\assets\images\imagefolder/villa012.jpg’},{’src’:’C:\xampp\xampp\htdocs\villa\assets\images\imagefolder/villa008.jpg’},{’src’:’C:\xampp\xampp\htdocs\villa\assets\images\imagefolder/villa003.jpg’},{’src’:’C:\xampp\xampp\htdocs\villa\assets\images\imagefolder/villa007.jpg’}]

    I have also tried using instead of calling the php file a snippet and calling [[getimage]] inside the javascript, although firebug gives me an access denied error when using this method!? So this is a side issue as I am sure it is much cleaner to make the call through a snippet.
    So in short to regain my sanity and advance my learning and flexibility of modx, I would appreciate greatly if someone could push me back on point.

    Kind regards and many thanks in advance.

    Yoshima
    smiley
      • 23299
      • 1,161 Posts
      Any updates on this?

      With the ongoing controversy with Flash this kind of solution is going to become more useful...

        • 36926
        • 701 Posts
        I use Jquery cycle plugin a lot.

        To set this up I use ditto to output the images from a resource. Very simple and easy to set up.

        If I require multiple galleries then I’d use maxi gallery.

        But from what I get from your post thats all you need


          • 23299
          • 1,161 Posts
          Benny,

          For those following at home can you share some details on using Ditto to make the jQuery cycle function?
            • 33208
            • 21 Posts
            Bennyb,

            many thanks for your input before I dig into your suggested method could you give some quick pointers to ease the pain.

            Many Thans

            Yosh
              • 36926
              • 701 Posts
              Quote from: yoshima at May 21, 2010, 11:40 AM

              Bennyb,

              many thanks for your input before I dig into your suggested method could you give some quick pointers to ease the pain.

              Many Thans

              Yosh

              Yosh,

              This is a basic ditto call i’ve used for jquery cyble before. parent=`3` being the resource container ID

              [[Ditto?parents=`3`&depth=`1`&tpl=`banners.Tpl`]]

              The banners.Tpl chunk just contains a call the a TV which i’ve set as an Image widget:
              [+bannerImage+]

              Alternative solution is checking out evoGallery http://svn.modxcms.com/docs/display/ADDON/EvoGallery.

              I’ve just started to look at this myself and it’s looking very promising.

              Ben
                • 33208
                • 21 Posts
                Ben,

                thanks for the reply! I have implemented with EvoGallery and eveything looks good!!!

                Thanks and solved!!