Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions /

Thumbnail Image using SetRatioSize


Reply


896 Views

Avatar
rog

Community Member, 8 Posts

26 May 2011 at 10:56pm

I have been unable to get a thumbnail image for the function below. Maybe there is a better way to write it?

Page.php
...
   function GetFiles() {
      $id = $this->ID;
      $obj         = "FileAttach";
      $filter       = "ArticleID = $id";
      $sort         = "";
      $join         = "LEFT JOIN File ON (File.ID = FileAttach.FileID)";
      $limit         = "";
      $data = DataObject::get($obj, $filter, $sort, $join, $limit);
      return $data;
   }
..

Page.ss
<% control GetFiles %>
   $ID $Filename $File.URL // Works as you would expect it to and shows the ID, Filename and URL
   $File.CMSThumbnail // Works and shows Icon and Link
   $File.SetRatioSize(150,150) // Shows nothing
<% end_control %>