Use Imagecache for Block Display
goodeit - August 11, 2008 - 19:45
| Project: | Ubercart Manufacturers |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
Description
I'm trying to get uc_manufacturer to use an imagecache preset for the block... this keeps files consistent and makes uploading new files easier (e.g. don't have to resize them beforehand). It would probably be better to use a different preset than the one setup for the manufacturer page, because that one is pretty small.

#1
Looking further into it, uc_manufacturer_block should probably be a theme function.
#2
Here's my first stab at it... seems to work fine (but its not themed). all I did was comment out line 283 and then add:
<?php$content .= l(theme('imagecache', 'manufacturer_block', $man->logo, $man->name, $man->name), ($man->url ? $man->url : uc_manufacturer_path($man)), array('target' => '_blank'), null, null, false, true);
?>
the imagecache preset is called 'manufacturer_block'.
#3
hi gooedit,
Thanks!
It worked for me. I'm a nube.;), so I also tried this code; both worked just fine.
<?php
$content .= l('<img src="'. base_path() . 'files/imagecache/manufacturer_block/' . $man->logo .'" alt="'. $man->name .' Logo" />', $man->url, array('target' => '_blank'), null, null, false, true);
?>
What's the proper way to add this to the code? a patch, theme function? Happy to contrib, if anyone can point me int he right direction, me being a nube and all.