Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2005
    Location
    Austin, Texas, US
    Posts
    216
    Plugin Contributions
    0

    help question Add Text Heading Above Additional Images

    My apologies if I am blind, I have been search for a few hours here and there with no luck finding this answer. If you know of a thread that talks about this, feel free to link.

    What I would like to do is add a simple text such as "Additional Views" above where additional images are displayed for the products. I realize I could just add this to the template file, BUT I only want it to show if there are actually additional images present for the product (many items have only 1 main image).

    Has anyone done this? I am not a php master but I can get around it and I have fairly good ZenCart experience if someone can point me to the right lines of code.

    I have also searched the admin for a while and I didn't see any layout option or product type layout option available for this. Might be a nifty add on in some future release. If a hundred people haven't already thought of it....or if again, I am not just blind and missing it :)

    BTW - This is in regards to a site running ZenCart 1.3.7.

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Add Text Heading Above Additional Images

    I suggest that you take a look at the tpl_modules_additional_images.php template. It's very short and easy to understand and if you insert your text inside the IF statement, it will only show when additional images exist and are being displayed.

    Even better there's already a variable $num_images available to you so that you could use singular text when there's only one image or plural text if there are several.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Jun 2005
    Location
    Austin, Texas, US
    Posts
    216
    Plugin Contributions
    0

    Default Re: Add Text Heading Above Additional Images

    Thank you so much. I suspected that was the file, but I was afraid to break it. I guess I shouldn't be so shy since I am using overrides in my custom template and I could always revert back in a disaster. So anyway, here is what I did:

    Just under the div tag with the productAdditionalImages class, I included a break tag and my text "Additional views of this product:" (without quotes).

    I made this edit only to my custom copy in my custom template directory.
    It is only displaying for products that actually do have additional images.
    Piece of cake!

  4. #4
    Join Date
    Oct 2007
    Posts
    289
    Plugin Contributions
    0

    Default Re: Add Text Heading Above Additional Images

    tpl_modules_additional_images.php - Around line 18

    <h4>Additional Views</h4>
    <div id="productAdditionalImages">
    <?php require($template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_columnar_display.php'); ?>
    </div>
    [FONT=Microsoft Sans Serif]CSS Evangelist[/FONT]

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

    Default Re: Add Text Heading Above Additional Images

    Is there any way we might be able to assign different text to the heading based on different categories? For example, one category would say "Available Textures" and another would say "Available Colors." How would one go about this?

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

    Default Re: Add Text Heading Above Additional Images

    You can check the value of $_GET['cPath'] against a list of category paths and output the corresponding text for whatever matches. You can get as fancy as you like with this.

  7. #7
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Add Text Heading Above Additional Images

    Quote Originally Posted by swamyg1 View Post
    Is there any way we might be able to assign different text to the heading based on different categories? For example, one category would say "Available Textures" and another would say "Available Colors." How would one go about this?
    Quote Originally Posted by gjh42 View Post
    You can check the value of $_GET['cPath'] against a list of category paths and output the corresponding text for whatever matches. You can get as fancy as you like with this.
    Or you could use attribute images instead of additional images to display your textures and colors - what you're describing is exactly what they're there for.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

 

 

Similar Threads

  1. v154 CSS: Centering Main Image Above Additional Images
    By Feznizzle in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 26 Mar 2016, 03:03 PM
  2. Replies: 2
    Last Post: 3 Sep 2013, 10:19 PM
  3. 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
  4. I want to add text below additional images
    By spiritcraft in forum Templates, Stylesheets, Page Layout
    Replies: 13
    Last Post: 26 Feb 2011, 11:06 PM
  5. Adding text/images above Product Listings?
    By absoluteblock in forum General Questions
    Replies: 1
    Last Post: 3 Feb 2007, 01:16 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR