CSS for the Timthumb plugin for CakePHP

0

Is there any way to apply CSS classes to the thumbnails created by the Timthumb plugin for CakePHP ? The 'class' attribute causes an error.

Code

$this->Fancybox->setPreviewContent($this->Timthumb->image('/img/gallery/' . $gallery_image['GalleryImage']['path'] , array('width' => '267px', 'height' => '189px')));
    
asked by anonymous 25.03.2014 / 17:01

1 answer

1

Resolution

I was only able to apply to <td> to class="thumbnail" , however I then had to add style="display:inline-block;" since the thumbnails were presented vertically instead of 4% for every <tr> like me wanted.

Code

<h2>Galeria</h2>
<table >
<tr>
    <?php
        $i=0;
        foreach( $gallery_images as $gallery_image ):?>
        <td align="center" class="thumbnail" style="display:inline-block;">
        <?php
            $src3 =$this->webroot. 'img/gallery/' .$gallery_image['GalleryImage']['path'];
            $this->Fancybox->setProperties( array( 
            'class' => 'fancybox3',
            'className' => 'fancybox.image',
            'title'=>'Single Image',
            'rel' => 'gallery1'
                  )
            );
            $this->Fancybox->setPreviewContent($this->Timthumb->image('/img/gallery/' . $gallery_image['GalleryImage']['path'] , array('width' => '267px', 'height' => '189px')));
            $this->Fancybox->setMainContent($src3);
            echo $this->Fancybox->output();
    ?>
    </td>
    <?php $i++;
        if($i==4){
            echo "</tr><tr>";
            $i=0;   
        }
    ?>
<?php endforeach ?>
</tr>

    
25.03.2014 / 17:50