fossie@drupal.org
Nifty Products Tutorial Part 1 (132 replies) Wed, 03/19/2008 - 19:04
- Show discounted price by uc_discount module (02/14/2010 - 22:42)
- Product Attributes (01/17/2010 - 01:04)
- Adding Attributes (01/17/2010 - 05:11)
- Why? (10/17/2009 - 01:32)
- Re: Nifty Products Tutorial Part 1 (08/17/2009 - 12:24)
- Hello All,
I've read through (09/06/2009 - 14:59)
- Re: Hello All, I've read through (09/06/2009 - 16:26)
- Hello All,
I've read through (09/06/2009 - 14:59)
- This is really useful. I've (07/16/2009 - 18:30)
- Re: This is really useful. I've (07/16/2009 - 19:47)
- How do I do the images... (07/17/2009 - 14:34)
- Re: This is really useful. I've (07/16/2009 - 19:47)
- Re: Nifty Products Tutorial Part 1 (07/01/2009 - 15:43)
- For images, I don't think this is the right way... (07/01/2009 - 00:50)
- Re: Nifty Products Tutorial Part 1 (05/22/2009 - 14:21)
- almost working... (04/05/2009 - 02:01)
- Re: almost working... (04/09/2009 - 05:55)
- Re: Re: almost working... (04/09/2009 - 18:20)
- Re: almost working... (04/09/2009 - 05:55)
- Re: Nifty Products Tutorial Part 1 (03/31/2009 - 07:27)
- RidolfiDesigns wrote:Adding (05/22/2009 - 13:36)
- Danny_Joris (05/23/2009 - 16:50)
- Re: Danny_Joris (05/27/2009 - 23:05)
- Re: Re: Danny_Joris (06/21/2009 - 04:08)
- Thickbox and themed product page (06/10/2009 - 22:31)
- Re: Danny_Joris (05/27/2009 - 23:05)
- Danny_Joris (05/23/2009 - 16:50)
- RidolfiDesigns wrote:Adding (05/22/2009 - 13:36)
- Thickboc with Jquery Cycle (03/10/2009 - 13:29)
- Thanks a lot! (09/08/2009 - 05:38)
- Re: Thanks a lot! (09/08/2009 - 23:36)
- Great topic! However I (03/13/2009 - 00:21)
- Thanks a lot! (09/08/2009 - 05:38)
- Page title (03/05/2009 - 07:41)
- Remove Title (03/10/2009 - 13:17)
- Attributes working with node-product. (10/30/2008 - 16:02)
- About Thickbox intergration (10/23/2008 - 10:40)
- Re: About Thickbox intergration (10/23/2008 - 11:54)
- Regarding to the images: if (09/24/2008 - 08:03)
- fossie@drupal.org (11/20/2008 - 22:52)
- new code, working well! (11/23/2008 - 17:46)
- Re: new code, working well! (02/11/2009 - 04:39)
- Re: Re: new code, working well! (02/11/2009 - 11:42)
- Re: new code, working well! (02/11/2009 - 04:39)
- new code, working well! (11/23/2008 - 17:46)
- fossie@drupal.org (11/20/2008 - 22:52)
- Using Tabs (09/06/2008 - 22:07)
- Default node-product.tpl.php (09/06/2008 - 15:50)
- NecroHill wrote:Nice work (09/06/2008 - 23:50)
- This doesn't work for me :( (09/07/2008 - 15:01)
- NecroHill wrote:Im using (09/08/2008 - 09:04)
- Ryan wrote:NecroHill (09/08/2008 - 10:35)
- Re: This doesn't work for me :( (09/07/2008 - 18:57)
- NecroHill wrote:Im using (09/08/2008 - 09:04)
- This doesn't work for me :( (09/07/2008 - 15:01)
- NecroHill wrote:Nice work (09/06/2008 - 23:50)
- Modifing the Categories and Product Listings Pages (08/28/2008 - 16:39)
- Option Images not displaying/swatching on custom template (08/26/2008 - 15:25)
- Re: Nifty Products Tutorial Part 1 (08/07/2008 - 17:05)
- Re: Re: Nifty Products Tutorial Part 1 (08/07/2008 - 22:11)
- alien73 wrote:If you need to (08/07/2008 - 23:53)
- Re: alien73 wrote:If you need to (08/08/2008 - 10:31)
- alien73 wrote:If you need to (08/07/2008 - 23:53)
- Re: Re: Nifty Products Tutorial Part 1 (08/07/2008 - 22:11)
- Re: Nifty Products Tutorial Part 1 (06/17/2008 - 23:36)
- Re: Nifty Products Tutorial Part 1 (06/01/2008 - 19:16)
- Bump! (07/07/2008 - 15:13)
- How do I print a custom field? (07/08/2008 - 14:56)
- Re: How do I print a custom field? (10/06/2008 - 13:54)
- Why doesn't this work? (10/09/2008 - 14:43)
- Re: Why doesn't this work? (10/09/2008 - 15:50)
- Why doesn't this work? (10/09/2008 - 14:43)
- Re: How do I print a custom field? (10/06/2008 - 13:54)
- How do I print a custom field? (07/08/2008 - 14:56)
- Re: Re: Nifty Products Tutorial Part 1 (06/06/2008 - 02:26)
- Bump! (07/07/2008 - 15:13)
- Re: Nifty Products Tutorial Part 1 (05/29/2008 - 01:29)
- Re: Nifty Products Tutorial Part 1 (05/26/2008 - 09:17)
- Reduced Price (05/25/2008 - 04:10)
- Re: Reduced Price (05/25/2008 - 12:04)
- Need thickbox for picture (05/22/2008 - 15:06)
- Re: Need thickbox for picture (05/22/2008 - 15:28)
- Re: Re: Need thickbox for picture (05/22/2008 - 19:00)
- Imageproblem (09/15/2009 - 07:17)
- Works well but no title? (09/24/2009 - 15:44)
- Re: Works well but no title? (09/25/2009 - 09:01)
- mplsdan wrote: Not sure if (01/13/2010 - 15:24)
- Re: Works well but no title? (09/25/2009 - 09:01)
- Works well but no title? (09/24/2009 - 15:44)
- Re: Re: Re: Need thickbox for picture (06/04/2008 - 21:24)
- Image Resize (05/22/2008 - 23:17)
- Re: Image Resize (06/13/2008 - 12:04)
- Insurrectus wrote:I'm Using (10/20/2008 - 21:18)
- fixed (10/20/2008 - 21:32)
- Code Is Live and Working Great (06/17/2008 - 12:50)
- I would like to learn create a site like this (04/20/2009 - 20:50)
- Printing % change instead of $$ saved (05/20/2009 - 21:35)
- Improved CSS (11/11/2008 - 10:36)
- Re: Improved CSS (11/11/2008 - 11:22)
- Preserve valid XHTML (11/11/2008 - 20:23)
- Re: Improved CSS (11/11/2008 - 11:22)
- Re: Code Is Live and Working Great (06/17/2008 - 12:57)
- I would like to learn create a site like this (04/20/2009 - 20:50)
- Insurrectus wrote:I'm Using (10/20/2008 - 21:18)
- Re: Image Resize (05/23/2008 - 00:30)
- Re: Re: Image Resize (05/23/2008 - 00:48)
- Foreach PHP Error (05/23/2008 - 16:09)
- Alaska wrote:Seems that (05/24/2008 - 03:23)
- Image Cache Code (05/24/2008 - 03:50)
- Alaska wrote:Would this then (05/24/2008 - 08:13)
- futurist wrote: ...The (11/11/2009 - 09:28)
- Thickbox Loading Bar (10/21/2008 - 02:36)
- Alaska wrote:Would this then (05/24/2008 - 08:13)
- Image Cache Code (05/24/2008 - 03:50)
- Alaska wrote:Seems that (05/24/2008 - 03:23)
- Image Next - Previous (05/23/2008 - 01:55)
- Foreach PHP Error (05/23/2008 - 16:09)
- Re: Re: Image Resize (05/23/2008 - 00:48)
- Re: Image Resize (06/13/2008 - 12:04)
- Imageproblem (09/15/2009 - 07:17)
- Re: Re: Need thickbox for picture (05/22/2008 - 19:00)
- Re: Need thickbox for picture (05/22/2008 - 15:28)
- Re: Nifty Products Tutorial Part 1 (05/20/2008 - 00:26)
- Re: Re: Nifty Products Tutorial Part 1 (05/20/2008 - 09:24)
- Hi,
I tried out the code (05/19/2008 - 10:17)
- blueeeeie wrote:
Hi,
I tried (06/30/2009 - 06:25)
- Ok, i am here now: I created (06/30/2009 - 09:33)
- trick with thumbnails (12/16/2009 - 07:45)
- Hi Everyone, This thread has (01/08/2010 - 14:07)
- trick with thumbnails (12/16/2009 - 07:45)
- Ok, i am here now: I created (06/30/2009 - 09:33)
- blueeeeie wrote:
Hi,
I tried (06/30/2009 - 06:25)
- Preselection radio button (05/19/2008 - 02:48)
- Re: Nifty Products Tutorial Part 1 (05/15/2008 - 02:07)
- Discounted price does not show up - Only the higher sell price (05/15/2008 - 03:44)
- Re: Nifty Products Tutorial Part 1 (04/22/2008 - 00:54)
- Hey end user
I would just (04/22/2008 - 02:42)
- Re: Hey end user
I would just (04/22/2008 - 20:04)
- Re: Re: Hey end user (04/23/2008 - 12:19)
- Few thinigs missing. (04/23/2008 - 13:11)
- Hi
This is what I have for (04/23/2008 - 13:39)
- Re: Hi
This is what I have for (04/23/2008 - 13:51)
- Re: Re: Hi (05/01/2008 - 12:46)
- Re: Re: Re: Hi (05/01/2008 - 13:19)
- Re: Re: Re: Re: Hi (05/15/2008 - 21:12)
- Product Nodes (05/15/2008 - 22:57)
- File locations for mode-product.tpl.php (05/15/2008 - 22:19)
- Thickbox - Only one image shows (05/15/2008 - 00:06)
- Add to Cart - Not showing lower List Price (05/15/2008 - 15:54)
- Re: Thickbox - Only one image shows (05/15/2008 - 07:59)
- Thickbox (05/15/2008 - 14:43)
- Re: Thickbox (05/15/2008 - 15:09)
- Thickbox (05/15/2008 - 14:43)
- Re: Re: Re: Re: Hi (05/15/2008 - 21:12)
- Re: Re: Re: Hi (05/01/2008 - 13:19)
- Re: Re: Hi (05/01/2008 - 12:46)
- Re: Hi
This is what I have for (04/23/2008 - 13:51)
- Hi
This is what I have for (04/23/2008 - 13:39)
- Few thinigs missing. (04/23/2008 - 13:11)
- hey end user just check for (04/23/2008 - 02:41)
- Re: Re: Hey end user (04/23/2008 - 12:19)
- Re: Hey end user
I would just (04/22/2008 - 20:04)
- Hey end user
I would just (04/22/2008 - 02:42)
- Re: Nifty Products Tutorial Part 1 (04/08/2008 - 09:31)
- Hey All
Thanks for the (04/08/2008 - 10:01)
- Re: Hey All
Thanks for the (04/17/2008 - 15:04)
- Re: Re: Hey All Thanks for the (04/17/2008 - 15:38)
- Re: Hey All
Thanks for the (04/17/2008 - 15:04)
- Hey All
Thanks for the (04/08/2008 - 10:01)
- Re: Nifty Products Tutorial Part 1 (04/08/2008 - 05:33)
- Hey spasmody (04/08/2008 - 09:58)
- node-tshirt.tpl.php (04/08/2008 - 08:20)
- Re: Nifty Products Tutorial Part 1 (03/21/2008 - 07:10)
- Hi darkbrewery try <li><a (03/22/2008 - 12:19)
- Re: Re: Nifty Products Tutorial Part 1 (03/21/2008 - 09:01)
- Re: Nifty Products Tutorial Part 1 (03/20/2008 - 04:35)
- Thanks darkbrewery (03/20/2008 - 06:54)
- Re: Thanks darkbrewery (03/20/2008 - 08:48)
- Hey Ryan
Thanks for the (03/20/2008 - 12:25)
- Re: Hey Ryan Thanks for the (03/20/2008 - 12:40)
- Hey Ryan
Thanks for the (03/20/2008 - 12:25)
- Re: Thanks darkbrewery (03/20/2008 - 08:48)
- Thanks darkbrewery (03/20/2008 - 06:54)

Regarding to the images:
if you use:
<?php$imagePath = $node->field_image_cache['0']['filepath'];?>
<div id="image"><img src="/files/imagecache/product/<?php print $imagePath; ?>" alt="Title"></div>
and there is no image, no image is display at all and there will be the image not found symbol.
While using the foreach (I prefer this way), without checking if their is an image, you'll get an error in 'foreach'. I check if $node->field_image_cache is not NULL.
<?phpif (!$node->field_image_cache == NULL) {
foreach ($node->field_image_cache as $image) {
// ... // display image
}
}
?>
Is their a better way to display images in custom node-product.tpl.php?
TIA,
Fossie
Fossie, your code is not working for me.
Would anyone help me improve the following code:
This is the way i'm currently showing my Lightbox images but I would like to make a check on the images, before showing them (to prevent the "image not found" on IE).
<!--show default image first, then others--><div class="product_image">
<?php $imagePath = $node->field_image_cache['0']['filepath']; ?>
<a href="<?=base_path()?><?=$imagePath?>" rel="lightbox[prod]"><img src="<?=base_path()?>files/imagecache/product/<?=$imagePath?>" alt="<?=$title?>" title="<?=$title?>" class="imagecache imagecache-product"></a>
<ul class="other_imgs">
<?php foreach ($node->field_image_cache as $images) { if ($images['filepath'] != $imagePath) { ?>
<a href="<?=base_path()?><?=$images['filepath']?>" rel="lightbox[prod]" title="<?=$title?>">
<img src="<?=base_path()?>files/imagecache/uc_thumbnail/<?=$images['filename']?>" alt="<?=$title?>" class="imagecache imagecache-uc_thumbnail"></a>
<?php } } ?>
</ul>
</div>
<!--/show default image first, then others-->
This works perfectly btw, except when there are no images attached and you get the "image not found" .