Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Additional image box label

Additional image box label

Locked

Views: 3,755

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
15 Feb 2009, 3:07 AM
#1
mickmo68 avatar

mickmo68

Zen Follower

Join Date:
Apr 2008
Location:
Boston
Posts:
129
Plugin Contributions:
0

Additional image box label

I would like to add some text above the additional product image box to label it just that. "More Photos" "Other Views", something like that to indicate that these images are related to the product above.

See screen shot to see what I mean.

Link to teat page:

http://keepsafeco.com/index.php?main_page=product_info&cPath=29_31&products_id=92

How would I do this?
Thank you

15 Feb 2009, 6:27 PM
#2
jwitt98 avatar

jwitt98

New Zenner

Join Date:
Feb 2009
Posts:
95
Plugin Contributions:
0

Re: Additional image box label

You will need to modify your tpl_modules_additional_images.php file in the following path:
\includes\templates\YOUR_CUSTOM_TEMPLATE_DIRECTORY\templates\tpl_modules_additional_images.php where YOUR_CUSTOM_TEMPLATE_DIRECTORY is the name of your custom template.
You should first make a backup of this file before making any changes.
Highlighted in green is the code you want to insert:

<div id="productAdditionalImages"> <h3 class="photo_caption">More Photos</h3> <?php require($template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_columnar_display.php'); ?> </div>

Then you will need to add the following to your stylesheet:

.photo_caption {
margin: 0;
color: #000;
font-size: 1.5em;
text-align: left;
}

This is just a sample, you can use whatever styling you need.

15 Feb 2009, 8:36 PM
#3
mickmo68 avatar

mickmo68

Zen Follower

Join Date:
Apr 2008
Location:
Boston
Posts:
129
Plugin Contributions:
0

Re: Additional image box label

Thank you so much jwitt98 :clap:

6 Mar 2009, 5:34 AM
#4
mickmo68 avatar

mickmo68

Zen Follower

Join Date:
Apr 2008
Location:
Boston
Posts:
129
Plugin Contributions:
0

Re: Additional image box label

I would like to take this a step further and have the box caption read:
"More photos of PRODUCT_DESCRIPTION" for SEO purposes as this is a header.
Any help with the code would be appreciated.

6 Mar 2009, 7:22 AM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Additional image box label

You could use this for the heading:```php

<h3 class="photo_caption">More Photos of <?php echo $products_name; ?></h3> ```
6 Mar 2009, 5:53 PM
#6
mickmo68 avatar

mickmo68

Zen Follower

Join Date:
Apr 2008
Location:
Boston
Posts:
129
Plugin Contributions:
0

Re: Additional image box label

This forum is awesome!
Thank you both

7 Apr 2009, 2:40 PM
#7
helensama avatar

helensama

New Zenner

Join Date:
Dec 2006
Location:
Northwest Connecticut
Posts:
87
Plugin Contributions:
0

Re: Additional image box label

And I'd like to take this even one step further, I'd like to have each additional image have a label. Underneath each additional image appears - "larger image" in place of that or in addition to that I would like to have a label or description of the image. I installed the
Fual Slimbox (Libhtbox) addon and it is great in many ways, one of the ways is that when you click on the main image or any additional image to see a larger image, you can then click on NEXT or PREV to look at all the images. I need to have the additional image label or description appear in the lightbox. Currently, the product name appears for every image.

Has anyone done something like this? I've searched the forum, this thread is the clssest I can find to what I need to do. Thanks for this information already here and for any help or direction you can point me to!

7 Apr 2009, 3:08 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Additional image box label

I guess you didn't search on Additional Image Titles.

8 Apr 2009, 12:11 PM
#9
helensama avatar

helensama

New Zenner

Join Date:
Dec 2006
Location:
Northwest Connecticut
Posts:
87
Plugin Contributions:
0

Re: Additional image box label

THANKS! No, I didn't think to search on titles! As soon as I saw your response I thought I should have, though.... I'm about to download this and try it... I will post the results here, just wanted to say Thank you right away.... Helen

8 Apr 2009, 1:08 PM
#10
helensama avatar

helensama

New Zenner

Join Date:
Dec 2006
Location:
Northwest Connecticut
Posts:
87
Plugin Contributions:
0

Re: Additional image box label

Hello again, I've downloaded the Additional Image Title addon and looked at the read me instructions and.... don't understand how and where I am to add the title? For each additional image.... and there will be several for many products, I want a title... I've read this several times:

This checks to see if there is a constant defined for the image and, if so, displays its value either above or below the image; if not, displays just the image as usual.

Define a constant corresponding to each image, changing /, , . and - characters to _ characters so the constant name will be acceptable to PHP.

Do i modify additional_images.php? For each additional image??
Does anyone have any experience or examples they can provide?
Thanks...

8 Apr 2009, 2:19 PM
#11
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Additional image box label

Look at the next part of the readme:


  • In /includes/languages/english/extra_definitions/additional_image_titles_defines.php, define constants as shown.

define ('ADDIMG_TEXT_TOP','true'};//change to false to put text below images
define ('ADDIMG_RINGS_RING23_01_JPG','Additional View #1'); //example title for /images/rings/ring23_01.jpg
define ('ADDIMG_HOE_SIDE_JPG','Side View'); //example title for /images/hoe_side.jpg

If you want the text below the images, change 'true' to 'false'.

5 Jun 2009, 1:58 PM
#12
helensama avatar

helensama

New Zenner

Join Date:
Dec 2006
Location:
Northwest Connecticut
Posts:
87
Plugin Contributions:
0

Re: Additional image box label

I am now trying to get the Additional Image Titles add-on to work with Slimbox (Lightbox) addon so that the titles for the additional images carry through and appear in the Slimbox Lightbox when you click on larger image. Does anyone have this working? If it requires extra coding that is complicated, I am happy to make arrangements and pay for someone to do this, as I am not much of a php programmer and I also need to have this work asap.

8 Oct 2009, 1:53 AM
#13
jwburnside avatar

jwburnside

New Zenner

Join Date:
Jun 2009
Posts:
35
Plugin Contributions:
0

Re: Additional image box label

I didn't like having to define a constant for each additional image (and neither do my clients), so here is another way based on the image filename:

  • Create a sub-folder for the particular product in the images folder, mine is called coasters.

  • Upload the main image via control panel and put it in the product folder you created. My file is coaster.jpg

  • Upload the other images into the same folder and name them based on the attributes:
    coaster_Aqua.jpg
    coaster_Red.jpg
    coaster_Blue.jpg
    coaster_Magenta.jpg

Modify the code in additional_images.php around line 100. This just extracts the name out of the file. I'm sure there is a less stupid way to code this, but here you go:

$imagename = (explode("_",$file));
$imagename = $imagename[1];
$imagename = (explode(".",$imagename));
$imagename = $imagename[0];

$img_thumb = zen_image($products_image_directory . $file, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . $imagename;

Thats it. Now as you add additional images just name them according to the convention and you should be good to go. I haven't really tested this much so if it screws something up I apologize.

JW

8 Oct 2009, 6:15 AM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Additional image box label

Looks like it should work nicely as long as you want one-word titles. Nice-looking multi-word titles would be possible with some extra coding and firm naming conventions.

9 Oct 2009, 4:22 PM
#15
helensama avatar

helensama

New Zenner

Join Date:
Dec 2006
Location:
Northwest Connecticut
Posts:
87
Plugin Contributions:
0

Re: Additional image box label

I am using the Additional Image Titles and finding that if a title has an apostrophe in it, it causes problems/errors with the php. I temporarily left the apostrophes out. I did try enclosing the apostrophe in quotes or other apostrophes, but didn't work. Does anyone know of a solution to this? Thanks!

10 Oct 2009, 5:53 AM
#16
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Additional image box label

Escape apostrophes with a backslash in front: '