Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Troubleshooting substituting images for sidebox headings

    Posting the content of a PM conversation so it can be useful to more people:


    I have been switching out images for sidebox headers the "manual way" as described here https://www.zen-cart.com/tutorials/i...hp?article=135 , but am stuck on "who's online".

    I cannot seem to find the "define('BOX_HEADING_WHOS_ONLINE', 'WHO'SONLINE');" anywhere in the categories php., although i have found the whos_online php. file.

    My site is a heavily modified TM template and I have gotten a little wary of installing even more modifications.

    so my question is Can i change this last sidebox heading manually as before, or do i need to install a mod to finish?

    Thanks for your time.

    ===

    Sorry you went through all that work with the tutorial method. The Image Titles mod will automatically replace any sidebox heading with an image if you make one for it with the right name.

    Since TM changes so many things about the structure of pages in their templates, it is possible that the mod wouldn't work with your template; if so, post for help in the Image Titles support thread to be sure I see it. I prefer to help where it can benefit more than one person at a time.

    Look at the filenames in the mod readme and see if any of them are already in your TM template folders. The mod code is very simple and should be able to be put into TM versions of files.

    If you're wary about installing mods, bear in mind that every file you touch is a mod, and you are changing far more of them than Image Titles changes.

    To just change that sidebox heading per the tutorial, this is the file where it is defined:

    /includes/languages/english/whos_online.php

    Line #21 : define('BOX_HEADING_WHOS_ONLINE', 'Who\'s Online');

    ===

    One last question
    Is there an easy way to change the alt text for these images to anything other than "Powered by Zen Cart :: The Art of Ecommerce" or a way to simply turn the alt text "off"?

    Any thoughts would undoubtedly save me hours ...


    Thanks again

    ===

    You did this for your files?

    Now in includes/modules/sideboxes/CUSTOM/categories.php Find this:

    $title = BOX_HEADING_CATEGORIES;

    and change it to:

    $title = zen_image($template->get_template_dir(BOX_HEADING_CATEGORIES, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . BOX_HEADING_CATEGORIES, HEADER_ALT_TEXT);


    Remove the , HEADER_ALT_TEXT and you should lose the alt and title attributes.

    The tutorial should never have included that, as it is not a value that could ever be relevant to sideboxes:

    /includes/languages/english/header.php

    Line #20 : define('HEADER_ALT_TEXT', 'Powered by Zen Cart :: The Art of E-Commerce');


    You should change this define for your particular store anyway:

    /includes/languages/english/your_template/header.php

    Line #20 : define('HEADER_ALT_TEXT', 'Your Store Name');


    ===
    ===

    To summarize, the tutorial gives a more involved method of substitution than necessary, as the image can be inserted into the title output with only the define statement (no need to edit the /modules/sideboxes/ files - described by DrByte some time ago; I have been unable to find the thread with his exact instructions) and also creates an irrelevant alt tag.

    Both of these methods have a flaw, in that titles that are links have the [more] appended to them by
    tpl_box_default_left/right.php after the title content is set.
    PHP Code:
      if ($title_link) {
        
    $title '<a href="' zen_href_link($title_link) . '">' $title BOX_HEADING_LINKS '</a>';
      } 
    This will show [more] as well as the image, which is unlikely to be desirable.

    The Image Titles code modifies only tpl_box_default_left/right.php, working for all desired sideboxes without further file editing, and accounting for the presence of an image in deciding whether to append the [more].

  2. #2
    Join Date
    Aug 2009
    Location
    Carmi, IL
    Posts
    354
    Plugin Contributions
    0

    Default Re: Troubleshooting substituting images for sidebox headings

    Thanks for sharing...I can use this info.

 

 

Similar Threads

  1. background images for sidebox headings
    By Thannaree in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 16 Aug 2012, 08:47 AM
  2. Substituting mod code for core code in v2.0
    By gjh42 in forum Contribution-Writing Guidelines
    Replies: 7
    Last Post: 9 Sep 2009, 11:48 PM
  3. Need Help Troubleshooting New Products Scrolling Images Mod...
    By khopek in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 6 Dec 2008, 10:48 PM
  4. Sidebox headings
    By DanAllkins in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 20 Oct 2006, 05:40 PM

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