So what i have done is made an image cache profile for a content type's "page image" that basically just puts a user defined image into the header of each page
I'm using:
<?php print theme('imagecache', 'pageImg', $node->field_pageimg[0]['filepath']);
?>where my image field for the content type is "pageimg"
This works perfectly, the issue is, i want this same image field on multiple content types... Like i have a content type for "testimonials" and they would also require a page header, as well as webforms.. they also, would require an image header.
What i've done is I've made a few different image field names for each content type. example:
<?php print theme('imagecache', 'pageImg', $node->field_pageimg[0]['filepath']);
?><?php
print theme('imagecache', 'pageImg', $node->field_glossaryimg[0]['filepath']);
?><?php
print theme('imagecache', 'pageImg', $node->field_testimg[0]['filepath']);
?>
So, this works ALMOST perfectly.. the problem is in IE and Safari since only 1 or the 3 images load when you're on any given content type it shows little annoying red x's like there is a broken path to an image.
Now my question. Is there perhaps some php if else statement that one of you geniuses would write quickly to solve this issue or is there a better way all together for doing this.
the site i'm working on is available for preview at vps4433.inmotionhosting.com/~buzznabe/
Any help would be appreciated!
-Travis Stevens
Comments
Comment #1
sandrewj commentedIs this code in a custom block? If so, you could make separate blocks for each type and restrict them in the block settings to the correct types.
I don't know all the interaction with caching/performance between that and common code with an if statement.
Comment #2
sandrewj commentedComment #3
fizk commentedPlease reopen if this is still an issue with ImageCache 6.x-2.0-rc1.