Page 1 of 3 123 LastLast
Results 1 to 10 of 27
  1. #1

    Default Adding text to additional images individually

    Hello,
    I'm trying to add text to each individual additional image for each product. I have found some threads that have shown me how to add text to all pages. I would like to find a way to "title" each image individually.

    I use a custom template and my ZenCart info is:
    Server Host: host.nwwebdev.com (127.0.0.1)
    Database Host: localhost (127.0.0.1)
    Server OS: Linux 2.6.18-028stab059.6
    Database: MySQL 5.0.22

    I appreciate any help available. In order for me to properly communicate to my customers what they are looking at in each image, I have found I do need to "title" each image. I tried to get around this problem by using images with attributes, but it just isn't sufficient.

    My website is www.palomapottery.com

    Thanks you for your time!!!

  2. #2
    Join Date
    Dec 2008
    Location
    San Fran
    Posts
    382
    Plugin Contributions
    0

    Default Re: Adding text to additional images individually

    I am also very interested in this as my attributes hinge on my additional images. Could somebody please point us in the right direction?

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Adding text to additional images individually

    You should be able to process the image titles in /includes/modules/additional_images.php.

    To avoid having to put masses of single-use text in this file, I would take the approach of defining a set of captions in a language file, using constant names based on the product additional image names, and then as each image is processed, check if a corresponding constant is defined and insert its value into the output.

  4. #4
    Join Date
    Dec 2008
    Location
    San Fran
    Posts
    382
    Plugin Contributions
    0

    Default Re: Adding text to additional images individually

    Ooh this is exactly what I need to do. Is there, perhaps, an example or more information on how to code this? Would greatly appreciate if you could point me in the right direction

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Adding text to additional images individually

    It seems like a useful mod, so I'm working on it. It appears to be pretty simple.

  6. #6
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Adding text to additional images individually

    Quote Originally Posted by gjh42 View Post
    It seems like a useful mod, so I'm working on it. It appears to be pretty simple.
    Wouldn't it be better to have a table to store images, with name, link, etc? I'm thinking of going that way.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Adding text to additional images individually

    Here is a beta version of Additional Image Titles. It doesn't have a readme yet, so here are the instructions:

    Unzip on your pc, navigate to /includes/modules/ and change /your_template/ to the name of your custom template.

    Open /includes/languages/english/extra_definitions/additional_image_titles.php and add defines for your additional image files, like this:

    define ('ADDIMG_RINGS_RING23_01_JPG','Additional View #1');//title for /images/rings/ring23_01.jpg
    define ('ADDIMG_HOE_SIDE_JPG','Side View');//title for /images/hoe_side.jpg

    The code that does the work in /includes/modules/your_template/additional_images.php is quite simple:
    PHP Code:
        // additional image titles - gjh42 20090105
        
    $badchars = array('/','.','-',' ');//not allowed in constant names
        
    $add_const_name 'ADDIMG_' strtoupper(str_replace($badchars,'_',$file));
        
    // uses file ext and subdir if any in constant name,  e.g. ADDIMG_RINGS_RING23_01_JPG for /images/rings/ring23_01.jpg
        // define constants in /includes/languages/english/extra_definitions/additional_image_titles.php
        // if any other characters could be used in filename, add them to $badchars
        
    $link = (defined($add_const_name))? $add_const_name '<br />' $link$link;
        
    // /additional image titles - gjh42 20090105
        // List Box array generation: 
    It goes just before the list box array element is constructed.

    Sure, you could use a db table to do this instead. If you want to do another version, go ahead:)
    Last edited by gjh42; 29 Jan 2009 at 12:35 AM.

  8. #8
    Join Date
    Dec 2008
    Location
    San Fran
    Posts
    382
    Plugin Contributions
    0

    Default Re: Adding text to additional images individually

    WOW I haven't tested this yet but I have to say MANY THANKS!

    The Zen community is awesome so far (I came from Oscommerce).


  9. #9
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Adding text to additional images individually

    Here is an enhancement to allow styling the titles as desired:
    PHP Code:
        $link = (defined($add_const_name))? '<h4 class="addImgTitle">' $add_const_name '</h4>' $link$link
    Add to your stylesheet

    .addImgTitle {font-size: 1.0em; /*any other properties desired*/}

  10. #10
    Join Date
    Dec 2008
    Location
    San Fran
    Posts
    382
    Plugin Contributions
    0

    Default Re: Adding text to additional images individually

    Quote Originally Posted by gjh42 View Post
    Here is a beta version of Additional Image Titles. It doesn't have a readme yet, so here are the instructions:

    Unzip on your pc, navigate to /includes/modules/ and change /your_template/ to the name of your custom template.

    Open /includes/languages/english/extra_definitions/additional_image_titles.php and add defines for your additional image files, like this:

    define ('ADDIMG_RINGS_RING23_01_JPG','Additional View #1');//title for /images/rings/ring23_01.jpg
    define ('ADDIMG_HOE_SIDE_JPG','Side View');//title for /images/hoe_side.jpg

    The code that does the work in /includes/modules/your_template/additional_images.php is quite simple:
    PHP Code:
        // additional image titles - gjh42 20090105
        
    $badchars = array('/','.','-',' ');//not allowed in constant names
        
    $add_const_name 'ADDIMG_' strtoupper(str_replace($badchars,'_',$file));
        
    // uses file ext and subdir if any in constant name,  e.g. ADDIMG_RINGS_RING23_01_JPG for /images/rings/ring23_01.jpg
        // define constants in /includes/languages/english/extra_definitions/additional_image_titles.php
        // if any other characters could be used in filename, add them to $badchars
        
    $link = (defined($add_const_name))? $add_const_name '<br />' $link$link;
        
    // /additional image titles - gjh42 20090105
        // List Box array generation: 
    It goes just before the list box array element is constructed.

    Sure, you could use a db table to do this instead. If you want to do another version, go ahead:)
    Hey Glenn, I've followed your directions to a tee... I'm just getting the ADDIMG text displaying on my product page, for example " ADDIMG_BULK10_CURLY_JPG" not the "Curly" text I assigned.

    The image "bulk10_curly.jpg" displays just fine.


 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 3 Sep 2013, 10:19 PM
  2. v151 Is it possible to add images/text next to additional images?
    By pexter in forum General Questions
    Replies: 6
    Last Post: 21 May 2013, 09:47 PM
  3. Can I set a zoom name for additional images individually on product page?
    By wasabiman in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 14 Apr 2010, 12:46 PM
  4. Images On and off individually
    By ollie_dda in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 11 May 2008, 06:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg