to do that I'm using this snippet, which I got from https://cmscanbesimple.org/blog/list-images :uploads/images/mypicfolder
Code: Select all
$url = isset($params['/uploads/images/ ']) ? $params['/uploads/images/ '] : '';
$dir = cmsms()->config['root_path'] . DIRECTORY_SEPARATOR . $url;
echo "<ul>\n";
if (is_dir($dir))
{
if ($dh = opendir($dir))
{
while (($file = readdir($dh)) !== false)
{
if ( ('file' == filetype($dir . $file)) && (substr($file,0,6) != 'thumb_') )
{
echo '<li><a href="'.$url.$file.'" class="fancybox"><img src="'.$url.'thumb_'.$file.'" alt="'.$file.'" /></a>'."</li>\n";
}
}
closedir($dh);
}
}
echo "</ul>\n";
The custom field is called picfolder.
So in my news detail template I have this tag
{list_images url='{$entry->picfolder}'}
The problem is that I always get a list of some files on the root. but not the image files I want to display.
what am I doing wrong here?