Posted By

screamwork on 10/03/10


Tagged

drupal


Versions (?)

Drupal: Imagecache presets in templates


 / Published in: PHP
 

  1. <pre>
  2. <?php if ($account->picture) {
  3. print theme('imagecache', 'profile_pic', $account->picture, $alt, $title, $attributes);
  4. }
  5. else {
  6. print theme('imagecache', 'profile_pic', default_profile_pic.png, $alt, $title, $attributes);
  7. }
  8. ?>
  9. </pre>
  10.  
  11. //or this
  12. function theme_profile($image_path) {
  13. if (!$image_path) {
  14. $image_path = [path_to_default_image]
  15. }
  16. return theme('imagecache', $preset_name, $image_path);
  17. }

Report this snippet  

You need to login to post a comment.