That is correct: boxhead-boxid.gif.
boxhead-categories.gif,boxhead-search.gif, boxhead-manufacturers.gif...
That is correct: boxhead-boxid.gif.
boxhead-categories.gif,boxhead-search.gif, boxhead-manufacturers.gif...
Last edited by gjh42; 31 Jan 2009 at 10:39 PM.
Let me see if I understand this correctly...
This is the code in the tpl_box_default_left.php
$title = (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/boxhead-' . $box_id . '.gif') ? zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/boxhead-' . $box_id . '.gif') : $title);
if ($title_link) {
if (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/boxhead-' . $box_id . '.gif')) {
$title = '<a href="' . zen_href_link($title_link) . '">' . $title . '</a>';
} else {
$title = '<a href="' . zen_href_link($title_link) . '">' . $title . BOX_HEADING_LINKS . '</a>';
}
I viewed my source and this is what I found.
<td id="navColumnOne" class="columnLeft" style="width: 150px">
<div id="navColumnOneWrapper" style="width: 150px"><!--// bof: categories //-->
<table width="150px" border="0" cellspacing="0" cellpadding="0" class="leftbox" id="categories-table">
<tr class="leftboxheading" id="categories-heading-tr">
<!-- Sidebox Header -->
<td colspan="3" width="100%" class="leftboxheading" id="categories-heading-td">Products</td>
</tr>
<tr>
In a previous post I read
Change $title, '/boxhead-' and $box_id to fit the conditions. But that’s where I get confused. Is this even close to being right? I'm not sure what '/boxhead-' refers to.
$categories = (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/boxhead-' . $categories-heading-tr. 'boxhead-categories.gif') ? zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/boxhead-' . $categories-heading-tr. 'boxhead-categories.gif') : $categories);
if ($categories_link) {
if (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/boxhead-' . $ categories-heading-tr. ' boxhead-categories.gif ')) {
$categories = '<a href="' . zen_href_link($categories_link) . '">' . $categories . '</a>';
} else {
$categories = '<a href="' . zen_href_link($categories_link) . '">' . $categories . BOX_HEADING_LINKS . '</a>';
}
Or am I so far off that you are chuckling at my attempt to make these edits. :)
Is this code even close to being correct? If not, can someone assist me with the correct edits? Thanks!$categories = (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/boxhead-' . $categories-heading-tr. 'boxhead-categories.gif') ? zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/boxhead-' . $categories-heading-tr. 'boxhead-categories.gif') : $categories);
if ($categories_link) {
if (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/boxhead-' . $ categories-heading-tr. ' boxhead-categories.gif ')) {
$categories = '<a href="' . zen_href_link($categories_link) . '">' . $categories . '</a>';
} else {
$categories = '<a href="' . zen_href_link($categories_link) . '">' . $categories . BOX_HEADING_LINKS . '</a>';
}
You shouldn't need to edit tpl_categories.php to get Image Titles to work on the categories sidebox. Have you installed the mod files and created and named the image?
<table width="150px" border="0" cellspacing="0" cellpadding="0" class="leftbox" id="categories-table">
This indicates that you are using a very old version of Zen Cart (v1.2.x?), as v1.3.x doesn't use tables for most layout. It might also be a very old categories sidebox mod.
I haven't tested Image Titles on v1.2 and don't know if it will work correctly. You really should upgrade if this is the case.
Last edited by gjh42; 7 Mar 2009 at 09:09 PM.
Hi Glenn
Really sorry and I know I am having a major senior moment here but I just can't work out how to code this, even following the good instructions.
I am using the cherry_zen template. I am running v1.3.8a os zen-cart.
If I wish to replace the Search heading with an image, I have created an image named headbox-search.gif and I have uploaded that into the /includes/templates/cherry_zen/buttons/english directory:
Next I have looked at the page source and can see that the correct ID is 'search' - I think!!
Now I am unsure how to alter the code you have suppllied for my tpl_box_default_left.php. I have tried all sorts of combinations but nothing is showing on the site.
Can you please post what my code should look like - I know it's a lot to ask but I am stuck.
Rob
Last edited by robsnowden; 22 Jun 2009 at 10:32 AM.
if elephants could fly, I'd be a little more optimistic....
Hmmm
OK scrub the above post - I AM A MUPPET! I sorted it. Another case of making it more complicated that it is. Sorry.
One thing though. Is it possible to make the image any height? say like 150px wide x 100px deep. What is happening right now is that the images are showing but 'covering' the text below in the header box.
I have attached an example of my first attempt at a 'categories' image just for test.
Any ideas would be welcome.
Thanks
Rob
if elephants could fly, I'd be a little more optimistic....
As I expect you found, the file should be named boxhead-search.gif instead of headbox-search.gif; it does go into the /includes/templates/cherry_zen/buttons/english/ folder.
Can you give a link to your site? It may be a CSS issue, which I can best resolve by seeing it live.
Hmmm, well my typing skills leave a bit to be desired so thankfully it was only on my post that I typed the wrong name, but thanks for pointing it out. :)
Anyhoo, I have PM'd you the link details Glenn.
Rob
if elephants could fly, I'd be a little more optimistic....
Hi Guys, love the mod!
Having a touch of trouble getting it to work for the newsletter mod I installed.
the id is subscribeHeading
my filename is boxhead-subscribeHeading.gif
I have tried it with multiple multiple different filenames, and I get nuthin.
I tried to edit the subscribe_header.php, using your readme as a guide, but it was too over my head. I was wondering if you could help me get it to work? If its easier to somehow insert it using the filename in text somewhere, that would be fine too, but once again, out of my league!
Here is the subscribe_header.php
Hope I did that right. Thanks so much for the help!PHP Code:<?php
/**
* subscribe_header - this is a subscribe field that appears in the navigation header
* This uses the same base template as the subscribe sidebox.
*
* @package templateSystem
* @copyright Copyright 2003-2005 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: subscribe_header.php,v 1.1 2006/06/16 01:46:15 Owner Exp $
*/
if(defined('NEWSONLY_SUBSCRIPTION_ENABLED') &&
(NEWSONLY_SUBSCRIPTION_ENABLED=='true')) {
$show_subscribe_header= true;
}
if ($show_subscribe_header == true) {
$subscribe_text = HEADER_SUBSCRIBE_LABEL;
require($template->get_template_dir('tpl_subscribe_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_subscribe_header.php');
$title = '';
$title_link = false;
require($template->get_template_dir('tpl_box_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_box_header.php');
}
?>
Here is my site
You want to use not the filename, but the id of the actual sidebox. In this case, view source showsso you would name the image boxhead-subscribe.gif.Code:<!--// bof: subscribe //--> <div class="leftBoxContainer" id="subscribe" style="width: 200px"> <h3 class="leftBoxHeading" id="subscribeHeading">Newsletter</h3>