Forums / All Other Contributions/Addons / Additional Image Titles [support]

Additional Image Titles [support]

Results 1 to 20 of 68
23 Jan 2009, 04:35
#1
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Additional Image Titles [support]

Additional Image Titles is now available in Free Addons.

This mod allows you to add titles to product additional images on the product info page.

Define the title text in the new file included, following examples given in the file.
If a defined constant is found for an image, the title will be displayed.

You can globally set the titles to display above or below the image.


This is the result of the [thread=115827]Adding text to additional images individually[/thread] thread.
07 Apr 2009, 15:37
#2
mimi78 avatar

mimi78

New Zenner

Join Date:
Mar 2009
Posts:
78
Plugin Contributions:
0

Re: Additional Image Titles [support]

Thank you,
I installed the Image Titles but it's not working yet....
I'm wondering does it matter the format of the image?
and also does it matter the name of the image?
08 May 2009, 02:28
#3
loosefast avatar

loosefast

Zen Follower

Join Date:
Jun 2005
Posts:
199
Plugin Contributions:
0

Re: Additional Image Titles [support]

gjh42:

Additional Image Titles is now available in Free Addons.

This mod allows you to add titles to product additional images on the product info page.

Define the title text in the new file included, following examples given in the file.
If a defined constant is found for an image, the title will be displayed.

You can globally set the titles to display above or below the image.


This is the result of the [thread=115827]Adding text to additional images individually[/thread] thread.


Would there be a way to combine your Title addition feature onto the additional_images.php file that is included with ImageHandler2. That is, have the titles and also have Lightbox effect for the larger image?
08 May 2009, 06:02
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Additional Image Titles [support]

It would probably be possible, but I don't expect to work on that combination at this time. If anyone wants to have a crack at it, go ahead.

Mimi - Sorry I missed seeing your question when it was new. The image format or name would not matter, as long as you created the define correctly to correspond with them. You need to make sure there are no spaces in the names.
08 May 2009, 16:22
#5
helensama avatar

helensama

New Zenner

Join Date:
Dec 2006
Posts:
87
Plugin Contributions:
0

Re: Additional Image Titles [support]

I would like to use Additional Image Title on this site http://peterfasano.com/zen/ but can not get it to work I had to delete the additional_image_titles_defines.php where I had some sample titles from the extra definitions folder because of getting blank pages which I thought were blank lines at the bottom of php files, but could not find....

In additiion to having this work so that the titles appear above (or below) the additional images I need the titles to carry into Slimbox which I have installed so that in Slimbox (an addon) someone can look through the main and all the additional images and know what they are looking at...

I am using the additional images for the various different colors that each product comes in and it is important to have the exact color and code appearing whenever anyone is looking at an image.

So, I have two issues - one is to get the Additional IMage Titles working and two is to get the Additional Image Titles into Slimbox Any suggestions or help is greatly appreciated.
08 May 2009, 16:27
#6
helensama avatar

helensama

New Zenner

Join Date:
Dec 2006
Posts:
87
Plugin Contributions:
0

Re: Additional Image Titles [support]

I forgot to add in the post i just made --- a question - does the Additional Image Titles add on work with Image Handler.... I am looking at this and I asked a fellow web developer to look at it also and we both think that there is some type of conflict that is causing the Additional Image Titles not to work?
08 May 2009, 16:45
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Additional Image Titles [support]

I would need to see what your additional image names are and what constant names you have used in the defines.
When looking through the prints, I don't see any additional images to use as examples of naming.

BTW, I noticed that while paging through the products, every new page shows only the header/nav and it is necessary to scroll down to see any of the product image. This seems like poor ergonomics - you want to make it as comfortable as possible for customers to leaf through the patterns. You might consider an alternate product page header configuration that takes less height. The header design is beautiful, but function has to come first.


IH2 could indeed be causing a problem, since it renames the resized files into long strings and saves them in a separate cache. I think it's not so much a conflict as bypassing systems that don't work together.

The lightbox/slimbox mods probably do conflict, as in trying to modify the same files to do their job.
08 May 2009, 16:58
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Additional Image Titles [support]

Just noticed in loosefast's post that IH2 does have an additional_images.php file, so this would preclude simply loading the Additional Image Titles copy. The titles code is short, and may be able to be dropped into the other mods' versions of the file... unless they modify the same area of the file, which would make it tricky.
08 May 2009, 17:06
#9
helensama avatar

helensama

New Zenner

Join Date:
Dec 2006
Posts:
87
Plugin Contributions:
0

Re: Additional Image Titles [support]

For an example, under Fabrics, in Prints, there are two test products I set up with additional images - Avondale and Key Biscayne. The direct link for Avondale is http://peterfasano.com/zen/index.php?main_page=product_info&cPath=2_6&products_id=17

For avondale, I uploaded avondale.jpg as the main image and then
avondale_01.jpg, avondale_02.jpg ..... to avondale_05.jpg as the additional images

Then in additional_image_titles_define.php I put the following:

define ('ADDIMG_avondale_01_jpg','Avondale Cedar');
define ('ADDIMG_avondale_02_jpg','Avondale Cypress');
define ('ADDIMG_avondale_03_jpg','Avondale Dune');
define ('ADDIMG_avondale_04_jpg','Avondale Heather');
define ('ADDIMG_avondale_05_jpg','Avondale Heron');

I followed the uploading instructions for Additional Image Titles AddOn but immediately was unable to access the site because of blank pages, I checked all the php I had just uploaded for blank lines at the bootm, there are none, I had to delete additional_image_titles_define.php from the server to get the site appearing again....

Now I see that the image link for the avondale additional image shows as:

<img src="bmz_cache/3/39600fa8926b9993799b2a562959d941.image.150x170.jpg" alt="Avondale" title=" Avondale " width="150" height="170" />

instead of avondale_01.jpg its 39600fa8926b9993799b2a562959d941.image.150x170.jpg

Do you think this is image handler conflicting and interfering.... I'm going to go now and see if I can uninstall Image Handler....


Not only do I want and need to have the Additional Image Titles working, but I need to have them carry into Slimbox...


Also, thank you for your coments about the header, I have thought about that, I am hoping, maybe you can tell me -----I am now using the Smart Background addon for the header and I see that you - Glenn- wrote this also .... Thank you for these great addons, you see that they are useful, they are the very ones I am using here.... My question is and I was about to try this out With Smart Backgrounds for Headers can I have headers with different heights specified for different pages?
08 May 2009, 17:18
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Additional Image Titles [support]

PHP constants are typically written in uppercase, so the code looks for an uppercase version of the filename, as well as converting characters like / into _ so they don't break the constant name. So

define ('ADDIMG_avondale_01_jpg','Avondale Cedar');

would be

define ('ADDIMG_AVONDALE_01_JPG','Avondale Cedar');

except that the IH2 filename may be making this irrelevant.


Smart Backgrounds lets you specify the styling for the element in a particular page/category, so you should be able to set the height that way. It may take some reconfiguring of your header output, or it might be straightforward - can't tell without looking into it.
02 Jun 2009, 04:59
#11
empressd avatar

empressd

New Zenner

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

Re: Additional Image Titles [support]

gjh42:

PHP constants are typically written in uppercase, so the code looks for an uppercase version of the filename, as well as converting characters like / into _ so they don't break the constant name. So

define ('ADDIMG_avondale_01_jpg','Avondale Cedar');

would be

define ('ADDIMG_AVONDALE_01_JPG','Avondale Cedar');

except that the IH2 filename may be making this irrelevant.


Smart Backgrounds lets you specify the styling for the element in a particular page/category, so you should be able to set the height that way. It may take some reconfiguring of your header output, or it might be straightforward - can't tell without looking into it.


Hello Everyone,
I am new to zen and I am fighting hard to make it work.
I have additional images and added additional image title and got white page.
I am not quite sure what to do with or what i should put in the last part of the instructions. I tried adding 1 2 3 4 and not just side but font and back using the text that i see in the php file. I dont have images installed on my site as yet just the ones that come with zen. I want to know if i would have to list all of my images in the file at all times. or can the code put them in the place where they should go based on the example text that is given with the file. If i have to add the image title that is a work for i have thousands of images to add. I really need this to work for it will make things much better for me due to my site carries items that has many images.

I appreciate all the help I can get.

also i would love to know if i can change the month from my featured and new product title on the front page and i would love to add a banner in my header and dont know how to or where to go to add it. i would love to be able to add my template in to an editor like coffeecup so i can drag and drop the boxes where i want them is there anything out there like that. or i am will to do the work if i just know how to add the template into an editor and change up the layout so it fits how i want it

I thank you all for all the help you can give to me.
hope to hear something soon.

empress
11 Jun 2009, 03:23
#12
helensama avatar

helensama

New Zenner

Join Date:
Dec 2006
Posts:
87
Plugin Contributions:
0

Re: Additional Image Titles [support]

This is an update to my other posts in this string. I'm the one, hopefully not the only one, who needs to have the additional image titles from Glenn's mod appear with the larger images in Lightbox/Slimbox.

I've made some progress, since I am using both the Additional Image Title add-on and the Slimbox add-on, both add-ons have modifications to additional_images.php. At first I could only have one or the other, I've now successfully meshed the modifications so that the additional image titles are appearing and also clicking on larger image brings up the Lightbox so that is working. Here is an example of it, still needs finishing touches but am happy it is working this much: http://peterfasano.com/zen/index.php?main_page=product_info&cPath=1_9&products_id=2

I still need to have the additional image titles appear with the larger image in the Lightbox instead of where you see the product name in the lower left hand corner. Here is the bottom part of additional_images.php where I have meshed the two modifications together:

// Link Preparation:
// bof Zen Lightbox v1.4 aclarke 2007-09-22
if (ZEN_LIGHTBOX_STATUS == 'true' || FUAL_SLIMBOX == 'true') {

$script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="' . zen_lightbox($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" rel="lightbox[gallery]" title="' . addslashes($products_name) . '">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';

} else {

$script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . $large_link . '\\\')">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';

}
// eof Zen Lightbox v1.4 aclarke 2007-09-22

$noscript_link = '<noscript>' . ($flag_display_large ? '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large) . '" target="_blank">' . $thumb_regular . '<br /><span class="imgLinkAdditional">' . TEXT_CLICK_TO_ENLARGE . '</span></a>' : $thumb_regular ) . '</noscript>';

// $alternate_link = '<a href="' . $products_image_large . '" onclick="javascript:popupWindow(\''. $large_link . '\') return false;" title="' . $products_name . '" target="_blank">' . $thumb_regular . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>';

$link = $script_link . "\n " . $noscript_link;
// $link = $alternate_link;
// additional image titles
$add_img_constant = 'ADDIMG_' . strtoupper(ereg_replace('[/\\.-]','_',substr_replace($base_image,'',0,7)));// if any other characters could be used in filepath, add them to list [ ]
if (defined($add_img_constant)) {//add text above or below images
$link = (ADDIMG_TEXT_TOP)? '<h4 class="addImgTitle">' . constant($add_img_constant) . '</h4>' . $link: $link . '<h4 class="addImgTitle">' . constant($add_img_constant) . '</h4>';
}
// /additional image titles
// List Box array generation:
$list_box_contents[$row][$col] = array('params' => 'class="additionalImages centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => "\n " . $link);
$col ++;
if ($col > (IMAGES_AUTO_ADDED -1)) {
$col = 0;
$row ++;
}
} // end for loop
} // endif

?>

Does anyone with more php coding experience than I have, have any suggestions? I've tried replacing the constant ($products_name) with the constant ($add_img_constant) but that does not work. (I also have a post in the Commercial Help Needed section but since I haven't gotten a reply resulting in help, I've been working or trying to work on it myself.

Also in the additional_image_titles_define.php code I downloaded I got an error just after installing that I corrected in my own copy. The error was ..... unexpected } encountered on line #6 --- which is this line --- define ('ADDIMG_TEXT_TOP','true'};//change to false to put text below images

I change the } to a ) to correct the error.
11 Jun 2009, 05:48
#13
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Additional Image Titles [support]

Not sure how that one } got through - I must have fixed it in the live test copy and neglected to transfer it to the archive copy. I will correct the download as soon as I get time.

The $add_img_constant is not defined before $products_name appears in the code as posted, so it will not show in the popup if swapped. You need to move the additional image titles code to above the script call, while keeping it inside the same loop as it is currently. You would be right to use
constant($add_img_constant)
in place of
$products_name
in that location, once the setup is in place.
08 Jul 2009, 00:33
#14
helensama avatar

helensama

New Zenner

Join Date:
Dec 2006
Posts:
87
Plugin Contributions:
0

Re: Additional Image Titles [support]

I've got the additional image titles from Glenn's mod appearring with the larger images in Lightbox/Slimbox! That is working great! I have a request to have the Additional Image Title appear below the image, not above it.... I thought "no problem", there is a switch i.e. this line --

define ('ADDIMG_TEXT_TOP','false');//change to false to put text below images

in additional_image_titles_defines.php.... but true is only working, changing to false does not put the text below the images.

Has anyone else encountered this problem? I am wondering if it is because "larger image'" appears below the image?
08 Jul 2009, 09:36
#15
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Additional Image Titles [support]

Apparently because ADDIMG_TEXT_TOP is defined as a string, the ternary operator needs to explicitly test for the literal string 'true' instead of the implied true condition.
In /includes/modules/your_template/additional_images.php, line 106, replace
$link = (ADDIMG_TEXT_TOP)?
with
$link = (ADDIMG_TEXT_TOP == 'true')?[php]
// additional image titles
$add_img_constant = 'ADDIMG_' . strtoupper(ereg_replace('[/\\.-]','_',substr_replace($base_image,'',0,7)));// if any other characters could be used in filepath, add them to list [ ]
if (defined($add_img_constant)) {//add text above or below images
$link = (ADDIMG_TEXT_TOP == 'true')? '<h4 class="addImgTitle">' . constant($add_img_constant) . '</h4>' . $link: $link . '<h4 class="addImgTitle">' . constant($add_img_constant) . '</h4>';
}
// /additional image titles[/php]
I have finished upgrading the mod to current ZC submission standards as well as fixing the bugs, and will be submitting it to Free Addons. This sometimes takes considerable time with the devs busy on v2.0, so for now you can fix your own copies with the two simple patches in this thread.
08 Jul 2009, 10:04
#16
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Additional Image Titles [support]

Just for interest, when tested with the original code and ADDIMG_TEXT_TOP defined as simply false instead of 'false', the titles do appear below the images as they should.[php]define ('ADDIMG_TEXT_TOP',false);//change to false to put text below images[/php]
10 Jul 2009, 02:05
#17
helensama avatar

helensama

New Zenner

Join Date:
Dec 2006
Posts:
87
Plugin Contributions:
0

Re: Additional Image Titles [support]

Thanks Glenn! Changing $link = (ADDIMG_TEXT_TOP)?
to $link = (ADDIMG_TEXT_TOP == 'true')? works with my version, I didn't try specifying false instead of false because this modification made it work. I appreciate your prompt responses and that you provided this ZC Free Add On, for this particular site it is very important that the additional images have titles. Thanks again!
13 Nov 2009, 18:31
#18
jfoerch avatar

jfoerch

New Zenner

Join Date:
Nov 2009
Posts:
25
Plugin Contributions:
0

Re: Additional Image Titles [support]

Thanks, Glenn, for this addon. I've got everything working but one thing. If I have one additional image, the code I'm using is putting that image on the left side of the screen. But the text for the picture is centered, so they're not lined up.

I have downloaded and am using the "additional images" addon and you've been helping me out on that thread as well. So, since I'm using that addon and have modified it slightly, I figure there is something in that code that is changing the spacing for my pictures. Any thoughts?

Oh, and I downloaded this image title add on today and just a note, it still has that "{" error in the code. I was able to figure it out using the debugger (which worked great!).

Thanks.
13 Nov 2009, 20:34
#19
jfoerch avatar

jfoerch

New Zenner

Join Date:
Nov 2009
Posts:
25
Plugin Contributions:
0

Re: Additional Image Titles [support]

I guess never mind. I just decided to play around with it and guessed right. In the additional images stylesheet, I changed the margin to 0 under the additional image section and shazaam. Everything is now centered under the picture description. Thanks again for the mods. They really help juice up the shopping carts!
13 Nov 2009, 23:47
#20
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: Additional Image Titles [support]

Glad you got it working!