Jump to:

3447 Posts in 1032 Topics by 872 members

Template Questions

SilverStripe Forums » Template Questions » function returns no value

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 880 Views
  • dacar
    Community Member
    168 Posts

    function returns no value Link to this post


    one structure of my site is:

    ReferenzCategoryHolder and ReferenzCategory are extending page. Referenz extends dataobject.


    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");

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

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

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

          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.

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.