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 /

function returns no value


Reply


917 Views

Avatar
dacar

Community Member, 168 Posts

7 October 2009 at 12:10pm

Hi,

one structure of my site is:
page->ReferenzCategoryHolder->ReferenzCategory->Referenz

ReferenzCategoryHolder and ReferenzCategory are extending page. Referenz extends dataobject.

ReferenzCategory:

static $has_many = array(
   'Referenzen' => 'Referenz',
   'Stammdaten' => 'Stammdaten'
   );

In stammdaten.php i have placed my functions:

class Stammdaten_Thumbnail extends Image {
   
      function generateThumbLogo($gd) {
      $gd = $gd->PaddedResize(160, 90, "000000");

      $gd->setQuality(100);
      return $gd;
      }
      
      function generateThumbLogoGrey($gd) {
      $gd = $gd->PaddedResize(160, 90, "000000")->greyscale();

      $gd->setQuality(100);
      return $gd;
      }
      function generateThumbLogoColor($gd) {
      $gd = $gd->PaddedResize(160, 90, "000000");

      $gd->setQuality(100);
      return $gd;
      }
      
      function generateThumbLogoLaufband($gd) {
      $gd = $gd->resizeByHeight(30);

      $gd->setQuality(100);
      return $gd;
      }
}

in referenzCategory.ss i call the ThumbLogo function and it returns the thumbnail.

<% control getFirma %>
   <div style="margin-bottom:10px;"><img src="$LogoDetailuebersicht.ThumbLogo.URL" title="$Firmenname, $Ort" alt="$Firmenname, $Ort" class="logo" /></div>
<% end_control %>

How can i use the function in referenzCategoryHolder.ss? $LogoDetailuebersicht.ThumbLogo.URL does not return anything.
How can i debug the scope of my functions?

Greetings from germany, Carsten.