CG Products Module, a product detail issue

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
mccor
Forum Members
Forum Members
Posts: 12
Joined: Fri Jun 11, 2010 2:35 pm

CG Products Module, a product detail issue

Post by mccor »

CMS Made simple 1.7.1
Products Module 2.8.2
(I've installed all the required modules, all up to date.)

Hi, I've searched the forum for an answer to a couple of issues, but to no avail.

Any help would be hugely appreciated.




In the Products module, I add a new product called "test item", with the required info, and upload an image called "testitem.jpg" in the image field I've created (with "Is this a public field?:" checked). Uploads fine.

In the Preferences, jpg is allowed, and automatically create thumbnail, & preview images is on.

All is ok so far.

But when I view the product details on the product page it displays unwanted text over the thumbnail:

Custom Fields

Name: product_image
Type: image
Value: testitem.jpg



Also, the thumbnail is unclickable. It doesn't let you preview a larger image.

I have not changed the Detail template from it's default.


Thanks for some great Modules, and any help I can get for this issue :)
Last edited by mccor on Wed Jul 14, 2010 7:00 pm, edited 1 time in total.
mccor
Forum Members
Forum Members
Posts: 12
Joined: Fri Jun 11, 2010 2:35 pm

Re: CG Products Module, a product detail issue

Post by mccor »

Sorry to bump this, but the topic is about to go off the page.

I urgently need help with this, so any suggestions would be gratefully received
Ziggywigged
Power Poster
Power Poster
Posts: 424
Joined: Sat Feb 02, 2008 12:42 am

Re: CG Products Module, a product detail issue

Post by Ziggywigged »

I'm also struggling with this. From the templates, it seems only thumbnails are accessible.
Take a penny, leave a penny.
Peciura

Re: CG Products Module, a product detail issue

Post by Peciura »

To make picture clickable you need to include JavaScript like FancyBox or LightBox.
Then add class or 'rel' attribute to image link (class='fancybox' or rel='lightbox').
This is part of the template to use for FancyBox
{if count($entry->fields)}
{foreach from=$entry->fields key='name' item='field'}
{if $field->type=='image'}
{if !empty($field->thumbnail)}
file_location}/{$entry->field->value}' rel='products_id_{$entry->id}'>
file_location}/{$entry->field->thumbnail}" alt="{$entry->product_name|escape|truncate:80:''}"/>

{else}
file_location}/{$entry->field->thumbnail}" alt="{$entry->product_name|escape|truncate:80:''}"/>
{/if}
{else}
{*do whatever you want with other field *}
{/if}
{/foreach}
{/if}
FancyBox works not only with links () but also with divs so it is very versatile.
To keep things simple install module JQueryTools and include tags to the head of main template and you will have pictue how it works.
{JQueryTools action='incjs'}
{JQueryTools action='ready'}
You can use
file_location}/{$entry->field->value}' rel='fancybox[products_id_{$entry->id}]'>
but for that you need to know jQuery basics. Or replce fancybox with lightbox if you like it more.
Note: you may need to adjust CSS for LightBox or FancyBox.
Ziggywigged
Power Poster
Power Poster
Posts: 424
Joined: Sat Feb 02, 2008 12:42 am

Re: CG Products Module, a product detail issue

Post by Ziggywigged »

Thanks Peciura. This was helpful. I actually wanted to display the full size image on the details page and so I just used:

Code: Select all

{if $field->type == 'image' && isset($field->thumbnail)}
       <img src="{$entry->file_location}/{$entry->field->value}/{$field->value}" alt="{$entry->product_name}"/>
       {/if}
Hope that helps someone else.
Take a penny, leave a penny.
Post Reply

Return to “Modules/Add-Ons”