Forums / All Other Contributions/Addons / Image Titles Support Thread

Image Titles Support Thread

Views: 28,613

Results 41 to 60 of 156
17 Aug 2008, 7:58 PM
#41
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Image Titles Support Thread

Image Titles and Categories Dressing will not interfere with each other and can be used at the same time.

For v1.3.7 you need to use Image Titles v1.1 - some of the base files are different in v1.2 for v1.3.8 and will cause errors in v1.3.7.

In general, you can make a text replacement image the same size as the heading it is going in. Sometimes you may want to make it a bit smaller.

17 Aug 2008, 8:19 PM
#42
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Image Titles Support Thread

barleywine -

The code that makes Image Titles work is quite simple, and can be adapted to many situations.```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);


There may be situations where the output is controlled directly by a zen function and this code cannot be inserted neatly.
27 Sep 2008, 4:42 AM
#43
lazschu avatar

lazschu

New Zenner

Join Date:
Feb 2006
Posts:
28
Plugin Contributions:
0

Re: Image Titles Support Thread

Excellent MOD! Worked like a charm, if you remember to name your graphic with 'boxhead-' in the first place =)

Thank you for this...
Christina

21 Dec 2008, 5:48 AM
#44
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Image Titles Support Thread

With the release schedule announcement for Zen Cart v2.0, I want to confirm that I will be keeping Image Titles up to date with core code. I don't expect any change in mod functionality. The required adaptation should be minimal, so that the new version can be released soon after the final ZC v2.0 release.

29 Jan 2009, 4:42 PM
#45
giuly avatar

giuly

Zen Follower

Join Date:
May 2007
Location:
Italy
Posts:
438
Plugin Contributions:
0

Re: Image Titles Support Thread

hello Glenn thank to you for this mod.
I have uploaded all file and I have insert a gif image called
categorie.gif in
includes/template/mytemplate/buttons/italian

but it doesn't appear, why? I don't understan

the link is

hxxp://www.giocattoliamo.it/demosugar/
please if you can, I am doing a restyling of my ecommerce, so I would to insert this mod.

Thank you
:rolleyes:

29 Jan 2009, 7:12 PM
#46
giuly avatar

giuly

Zen Follower

Join Date:
May 2007
Location:
Italy
Posts:
438
Plugin Contributions:
0

Re: Image Titles Support Thread

gjh42:

The image filename for each sidebox needs to include the name (id) of the sidebox.

The categories box has an id of categories, so its image file will be named boxhead-categories.gif.

ok I've tried and goes in english language.
The question is where do I find the name (id) of the sidebox?
:blush:

30 Jan 2009, 7:28 AM
#47
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Image Titles Support Thread

You can use a different image for each language; the code automatically uses the image that matches the current language in the shop. When the customer has selected Italian, the code will look for a file in /includes/templates/your_template/buttons/italian/.

To find the name of any sidebox, you can do a view source and look at the HTML that is being output. For Categories, look for the set of category links in the code, and note at the top of that list:

<div id="categories">

The id stays the same no matter the language in use, so you would use the same filename for images in any language. They should be saved in the appropriate language folder in /buttons/.

30 Jan 2009, 1:35 PM
#48
giuly avatar

giuly

Zen Follower

Join Date:
May 2007
Location:
Italy
Posts:
438
Plugin Contributions:
0

Re: Image Titles Support Thread

sorry but also for the image that goes I don't understand.

If i view the code of page it looks

<div class="leftBoxContainer" id="categories" style="width: 150px"> <h3 class="leftBoxHeading" id="categoriesHeading"><img src="includes/templates/sugar/buttons/english/boxhead-categories.gif" alt="" width="100" height="20" /></h3> <div id="categoriesContent" class="sideBoxContent"> <hr id="catBoxDivider" /> i have insert copying by you boxhead-categories.gif but where I saw that I have to insert boxhead before image.gif?

thank you for patience :blush:

30 Jan 2009, 10:36 PM
#49
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Image Titles Support Thread

You have boxhead-categories.gif saved in
includes/templates/sugar/buttons/english/boxhead-categories.gif, but not in includes/templates/sugar/buttons/italian/boxhead-categories.gif.

If you want the same image for both languages, just copy the file into the other language's /buttons/language/ folder.

If you want different images for each language, save each one with the same name, but in the correct language folder.

31 Jan 2009, 11:26 AM
#50
giuly avatar

giuly

Zen Follower

Join Date:
May 2007
Location:
Italy
Posts:
438
Plugin Contributions:
0

Re: Image Titles Support Thread

sorry, i didn't understand before.
So it is alwaysthe word BOXHEAD and the id of box?

It was if is always word boxhead.

Thank you very much
:clap:

6 Mar 2009, 5:25 PM
#52
rilken27 avatar

rilken27

New Zenner

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

Re: Image Titles Support Thread

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. :)

7 Mar 2009, 1:27 PM
#53
rilken27 avatar

rilken27

New Zenner

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

Re: Image Titles Support Thread

$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>';
}

Is this code even close to being correct? If not, can someone assist me with the correct edits? Thanks!

7 Mar 2009, 8:04 PM
#54
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Image Titles Support Thread

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.

22 Jun 2009, 9:27 AM
#55
robsnowden avatar

robsnowden

Zen Follower

Join Date:
Apr 2004
Location:
Up t'north, UK
Posts:
264
Plugin Contributions:
0

Re: Image Titles Support Thread

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

if elephants could fly, I'd be a little more optimistic....

22 Jun 2009, 9:49 AM
#56
robsnowden avatar

robsnowden

Zen Follower

Join Date:
Apr 2004
Location:
Up t'north, UK
Posts:
264
Plugin Contributions:
0

Re: Image Titles Support Thread

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....

22 Jun 2009, 12:49 PM
#57
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Image Titles Support Thread

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.

22 Jun 2009, 6:29 PM
#58
robsnowden avatar

robsnowden

Zen Follower

Join Date:
Apr 2004
Location:
Up t'north, UK
Posts:
264
Plugin Contributions:
0

Re: Image Titles Support Thread

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....

15 Oct 2009, 3:52 AM
#59
wudchuk avatar

wudchuk

New Zenner

Join Date:
Oct 2009
Posts:
29
Plugin Contributions:
0

Re: Image Titles Support Thread

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

<?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');
  }
?>

Hope I did that right. Thanks so much for the help!

Here is my site

15 Oct 2009, 7:37 AM
#60
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Image Titles Support Thread

You want to use not the filename, but the id of the actual sidebox. In this case, view source shows```

<!--// bof: subscribe //--> <div class="leftBoxContainer" id="subscribe" style="width: 200px"> <h3 class="leftBoxHeading" id="subscribeHeading">Newsletter</h3> ```so you would name the image boxhead-subscribe.gif.