We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33968
    • 863 Posts
    So just download it and follow the setup instructions smiley

    Just change the snippet to this and it will output the correct html for you, including <div id="slider">:
    <?php
    $dir = "assets/templates/temp_v1/carousel/";
    $output = '';
    if (is_dir($dir)) {
        if ($dh = opendir($dir)) {
            $output .= '<div id="slider">'."\n";
            while (($file = readdir($dh)) !== false) {
                if((filetype($dir.$file) == 'file') && ($file != '.') && ($file != '..')) {
                    $info = pathinfo($file);
                    $file_name =  basename($file,'.'.$info['extension']);
                    $output .= '    <img src="'.$dir.$file.'" alt="" />'."\n";
                }
            }
            $output .= '</div>'."\n";
            closedir($dh);
        }
    }
    return $output;
    

      • 1169
      • 312 Posts
      I see there is now a Tutorial on the nivo slider.
      http://modxcms.com/forums/index.php/topic,64552.0/topicseen.html#msg365184

      Hope this gets you going along with @lucas help and others you will have to change your <div>’s to match.
        DEVELOPMENT ENV:- Ubuntu 12.04 | MODx Revolution 2.2.8 | LAMP 2i Apache 2.2.22 | Php 5.3.10 | Mysql 5.5.31 MySQL client version: 5.5.31
        • 20865
        • 30 Posts
        I’m using jcarousel.
        http://sorgalla.com/projects/jcarousel/
        I don’t know JS well, but it wasn’t a problem for me to adjust it to my site.
        All that I have used is only getresources with a chunk.
          • 12793
          • 293 Posts
          Quote from: lucas at May 17, 2011, 02:48 AM

          So just download it and follow the setup instructions smiley

          Just change the snippet to this and it will output the correct html for you, including <div id="slider">:
          <?php
          $dir = "assets/templates/temp_v1/carousel/";
          $output = '';
          if (is_dir($dir)) {
              if ($dh = opendir($dir)) {
                  $output .= '<div id="slider">'."\n";
                  while (($file = readdir($dh)) !== false) {
                      if((filetype($dir.$file) == 'file') && ($file != '.') && ($file != '..')) {
                          $info = pathinfo($file);
                          $file_name =  basename($file,'.'.$info['extension']);
                          $output .= '    <img src="'.$dir.$file.'" alt="" />'."\n";
                      }
                  }
                  $output .= '</div>'."\n";
                  closedir($dh);
              }
          }
          return $output;
          





          Thanks for your reply!! I’ve downloaded the example from my link

          I’ve created a snippet named "carousel"

          In my assets/template I’ve a carousel folder


          Do I’ve insert jquery and css links what I’ve in demo.html example file??


          and after this, what I’ve to insert in my page for insert snippet, insert carousel script.

          I can’t do this sad(((



          Thanks
            • 33968
            • 863 Posts
            Quote from: il_dandi at Jul 11, 2011, 08:13 AM

            Do I’ve insert jquery and css links what I’ve in demo.html example file??
            Yes, do that. Insert them between your <head></head> tags for now and make sure the paths are correct.


            and after this, what I’ve to insert in my page for insert snippet, insert carousel script.

            I can’t do this sad(((
            Thanks
            Yes you can do it! Just insert:
            [[!carousel]] 

            in your template where you want the carousel to appear and it will render all the html you need.

            If you’ve followed everything on this thread and the Nivo slider instructions then it should be working for you.