CSS for the Timthumb plugin for Cakephp

Asked

Viewed 67 times

0

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

Code

$this->Fancybox->setPreviewContent($this->Timthumb->image('/img/gallery/' . $gallery_image['GalleryImage']['path'] , array('width' => '267px', 'height' => '189px')));
  • 1

    Just a few more details: now the definition of the class attribute that gave rise to the question & here in the Stack does not appear here in the code: http://pastebin.com/rLr7Hvhd

  • The problem was not the class itself, but the fact that in the plugin there is no such attribute in the helper.

1 answer

1


Resolution

All I had to do was apply <td> to class="thumbnail", however later I had to add, too, the style="display:inline-block;" because the miniatures were presented vertically, not 4 for each <tr>, how I wanted to.

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>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.