I would remove the HTML comments.
Two suggestions:
- change line in the snippet to:
$dir = "assets/templates/myfolder_v1/carousel/";
- call it uncached while testing:
[[!carousel]] (or [!carousel!] for Evo)
:(((
I’ve used
[[!carousel]] (on revo)
(without <!-- -->)
in my snippet I’ve:
$dir = "assets/templates/temp_v1/carousel/";
I show an empty page
Can you paste your full snippet here - not just that one line?
And... ’assets/templates/temp_v1/carousel/’ is definitely where your images are?
This is my snippet
<?php
$dir = "assets/templates/temp_v1/carousel/";
$output = ’’;
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if(filetype($dir.$file) == ’file’) && $file != ’.’ && $file != ’..’)
$info = pathinfo($file);
$file_name = basename($file,’.’.$info[’extension’]);
$output .= ’<img title="’.$file_name.’" alt="" src="’.$dir.$file’" />’;
}
closedir($dh);
}
}
return $output;
all my images are in
’assets/templates/temp_v1/carousel/’
-
☆ A M B ☆
- 894 Posts
Umm why not just use the gallery plugin and customize it with the gallery type you want to use?
I created
this gallery from scratch with some jquery although its not as fancy as probably what you want but the process is very simple.
Hmmm I think this can be my first tutorial
Now I show 2 images....
[[!carousel]]
Not 1 image but 2 images
in the same area
Thanks
It should display any images you have in that folder. So if two images, two displayed on screen.
I think you wanted to display them as a carousel, you need to set that up correctly so it will only show one image at a time. Which one are you trying to implement?
You now need to apply your jquery script you chose to now use the list you have created.
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