Add a link to the product image

A place to discuss and receive support for the Web Auction application.

Add a link to the product image

Postby bobede » Thu Nov 08, 2007 10:43 am

I would like to make the product image thumbnail, link to a new page showing the full size image. Just in the view_product page, not the product list.

Is there a way to do that?

Bob
bobede
 
Posts: 24
Joined: Tue Oct 30, 2007 7:01 am

Postby bobede » Thu Nov 08, 2007 11:51 am

I figured it out.

Code: Select all



It was a simple matter of adding the link to the above div.

Bob
bobede
 
Posts: 24
Joined: Tue Oct 30, 2007 7:01 am

Postby bobede » Thu Nov 08, 2007 11:52 am

Not sure why, but my code isn't posting correctly.

Bob
bobede
 
Posts: 24
Joined: Tue Oct 30, 2007 7:01 am

Postby shannah » Thu Nov 08, 2007 2:31 pm

Yeah. I'm still getting used to PHPBB myself. It seems to strip attributes out of HTML tags... i'll have to look into a fix.

So far it seems to be a little better for posting code than Plone was though.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby bobede » Mon Nov 12, 2007 11:39 am

I expanded on the idea of having a link to a larger image. I created new fields in the products table for image_two, image_three etc. and made changes to the templates>view_product.html page so that multiple thumbnails can be seen, and each one can be clicked for an enlarged view in a new window.

This works OK, but I would like to tweak it a bit. Right now, If there is only one image for the product, then a missing image icon is displayed for any missing images. What I would like to do, is have the app check the products table to see if image_two is null, and if it is, use code to display only product_image, if it is not null then use code to display product_image and image_two.

I was thinking that an if else would probably work for this, but being new to php I don't know the mechanics of checking the table for the values.

Any help would be appreciated.

Thanks

Bob
bobede
 
Posts: 24
Joined: Tue Oct 30, 2007 7:01 am

Postby bobede » Mon Nov 12, 2007 12:59 pm

Wow. I'm surprising myself.

I managed to get the if and else working to display either multiple thumbnails or a single thumbnail.

I would like to post the complete code but much of it is getting stripped out by phpbb. Here is the basic info.

Code: Select all
{if $product->val('image_two') != NULL}
code to display two images here

{else}
code to display a single image here

{/if}


I plan to expand this so that up to 4 thumbnails can be displayed by adding elseif sections.

Bob
bobede
 
Posts: 24
Joined: Tue Oct 30, 2007 7:01 am

Postby shannah » Mon Nov 12, 2007 2:34 pm

Thanks for posting this Bob. I'm sure this will be helpful to other users. Given that PHPBB seems to be stripping some of the HTML out, perhaps I'll set up a "snippets" section for people to post code snippets...
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Web Auction Discussion

Who is online

Users browsing this forum: No registered users and 24 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved