Load Thumbnail Images in Slider template

Permalink
Hi! How can I use thumbnail images in the concrete slider?

I am used to to this (to load thumbnail images in blogposts):
$thumbnail = $page->getAttribute('image_blog_post');

And then load the image
<img src="<?php  echo ($thumbnail->getVersion()->getRelativePath()); ?>"/>


But in the Slider the images are loaded this way:
<?php
                $f = File::getByID($row['fID'])
                ?>
                <?php if (is_object($f)) {
                $tag = Core::make('html/image', array($f, false))->getTag();
                if ($row['title']) {
                    $tag->alt($row['title']);
                } else {
                    $tag->alt("slide");
                }
                echo $tag;
                ?>
                <?php


I could not find a solution. Any thoughts/ help?

Maarten

 
c5dragon replied on at Permalink Reply
c5dragon
Docs:
https://documentation.concrete5.org/developers/working-with-files-an...

<?php
if($row['fID']){
    $fileObj = File::getByID($row['fID']);
    if(is_object($fileObj)){  
      $f = $fileObj->getApprovedVersion(); // Retrieves the approved version of a File
      $fileTitle = $f->getTitle();
      $fileDesc = $f->getDescription();
      $filePath = $f->getRelativePath();
    }
}
?>

Output
<?php if(!empty($filePath)){ ?>
  <img src="<?php echo $filePath; ?>" alt="<?php echo $fileTitle; ?>" />
<?php } ?>