Forums / Templates, Stylesheets, Page Layout / Trouble changing sidebox title to an image

Trouble changing sidebox title to an image

Locked

Views: 3,778

Results 1 to 20 of 27
This thread is locked. New replies are disabled.
3 Feb 2008, 4:28 AM
#1
julieoolie avatar

julieoolie

Zen Follower

Join Date:
Jul 2006
Location:
Southern California
Posts:
109
Plugin Contributions:
0

Trouble changing sidebox title to an image

I followed this tutorial: https://www.zen-cart.com/tutorials/index.php?article=135
I did exactly what it says but I'm getting a broken image for my title.

This is my shop: http://gleefulthings.com/shop/

my english.php file says:

// categories box text in sideboxes/categories.php
  define('BOX_HEADING_CATEGORIES', 'shop.jpg');

and my categories.php file says exactly what the tutorial said.

I'm confused :blink:

3 Feb 2008, 6:25 AM
#2
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Trouble changing sidebox title to an image

Did you also alter stylesheet of current template,
as per tutorial.

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

3 Feb 2008, 6:33 AM
#3
julieoolie avatar

julieoolie

Zen Follower

Join Date:
Jul 2006
Location:
Southern California
Posts:
109
Plugin Contributions:
0

Re: Trouble changing sidebox title to an image

No because I thought that was just to change the background that's behind the image/text.

3 Feb 2008, 6:35 AM
#4
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Trouble changing sidebox title to an image

julieoolie:

No because I thought that was just to change the background that's behind the image/text.
Try changing stylesheet as per tutorial

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

3 Feb 2008, 6:51 AM
#5
julieoolie avatar

julieoolie

Zen Follower

Join Date:
Jul 2006
Location:
Southern California
Posts:
109
Plugin Contributions:
0

Re: Trouble changing sidebox title to an image

I don't really understand what I'm supposed to put there. I don't want a background image on them.

3 Feb 2008, 6:57 AM
#6
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Trouble changing sidebox title to an image

visited site
path to missing image given as
/shop/includes/templates/template_default/images/shop.jpg
but you are using template
/templates/gleefulthings/

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

3 Feb 2008, 7:05 AM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Trouble changing sidebox title to an image

That would make a difference...

The tutorial actually gives a more complicated method of doing this. It requires editing a PHP file for every sidebox.
It is possible to specify the whole image replacement in the define without altering any other files - I don't have the exact format for this at hand, but it has been posted on the forum.

Or, you could install Image Titles, which takes care of the coding for sidebox titles in just a couple of files, and will apply to any sidebox where you save a correctly-named image in /your_template/buttons/english/. It also accounts for the [more] addition to some headers, which I believe the direct define method can't account for.

3 Feb 2008, 7:13 AM
#8
julieoolie avatar

julieoolie

Zen Follower

Join Date:
Jul 2006
Location:
Southern California
Posts:
109
Plugin Contributions:
0

Re: Trouble changing sidebox title to an image

misty:

visited site
path to missing image given as
/shop/includes/templates/template_default/images/shop.jpg
but you are using template
/templates/gleefulthings/

I'm not sure how to change this. I just told it shop.jpg.

3 Feb 2008, 7:22 AM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: Trouble changing sidebox title to an image

Are you sure you followed the file editing instructions exactly?> 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);

If you want to do more than one or two headings, you would be best off with another method than the one you are trying.

3 Feb 2008, 7:24 AM
#10
julieoolie avatar

julieoolie

Zen Follower

Join Date:
Jul 2006
Location:
Southern California
Posts:
109
Plugin Contributions:
0

Re: Trouble changing sidebox title to an image

I want to change all my headings. What's the easiest way to do this? I'm not all that familiar with zencart, I just found this method in the tutorials and assumed it was the only way.

3 Feb 2008, 7:59 AM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: Trouble changing sidebox title to an image

See post #7 above.

Image Titles will do the job with no fuss - just follow the readme to name and save your images.

I have been searching for the thread that gave the define image method, and haven't been able to remember the right keywords.

3 Feb 2008, 7:45 PM
#13
julieoolie avatar

julieoolie

Zen Follower

Join Date:
Jul 2006
Location:
Southern California
Posts:
109
Plugin Contributions:
0

Re: Trouble changing sidebox title to an image

Ok, I'm installing Image Titles as suggested in post #7. I'm confused by the readme file. It gives code to edit certain files but then it says that the files have already been edited. So I don't need to edit the files? :huh: When I look at those files I don't see the code that it says to replace but I also don't see the code that it says to replace it with.

I was just going to upload my titles to see if it would work as is but I'm confused by the naming.

3 Feb 2008, 8:17 PM
#14
gjh42 avatar

gjh42

Black Belt

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

Re: Trouble changing sidebox title to an image

The code explanation is for those who want to understand how it works, or need to merge the mod with another one that affects the same files.

Read the naming instructions carefully, as they are the heart of how the mod works to use the correct image. If the images are not named according to the system and loaded in the right place, they cannot be used.

"Name your header title images like boxhead-categories.gif and save in /your_template/buttons/your_language/.

Look in view source to get the box id at the top of each sidebox output."

3 Feb 2008, 8:23 PM
#15
julieoolie avatar

julieoolie

Zen Follower

Join Date:
Jul 2006
Location:
Southern California
Posts:
109
Plugin Contributions:
0

Re: Trouble changing sidebox title to an image

Ok so there's no need to modify the code then? got it :smile:

I named my image boxhead-categories.jpg and put it in the appropriate folder but it's not showing. Does it have to be a gif?

3 Feb 2008, 9:42 PM
#16
gjh42 avatar

gjh42

Black Belt

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

Re: Trouble changing sidebox title to an image

The way the code is written it needs to be a gif. It would be easy to change the code to use jpgs, but then all would have to be jpgs.

You can either reconfigure your images, or I can advise you where to make the file changes (.gif to .jpg in a half-dozen locations or so - fewer if you only want to use sidebox image headings).

3 Feb 2008, 10:05 PM
#17
julieoolie avatar

julieoolie

Zen Follower

Join Date:
Jul 2006
Location:
Southern California
Posts:
109
Plugin Contributions:
0

Re: Trouble changing sidebox title to an image

I ended up going back to the original method because it made more sense to me. I don't know what I did differently this time but they are all working now. I just can't figure out how to align them to the left.

http://gleefulthings.com/shop/

3 Feb 2008, 11:31 PM
#18
julieoolie avatar

julieoolie

Zen Follower

Join Date:
Jul 2006
Location:
Southern California
Posts:
109
Plugin Contributions:
0

Re: Trouble changing sidebox title to an image

Is it possible to align the titles to the left? I thought it would be simple with the stylesheet but it's not working. I tried with leftBoxHeading but no luck. Is there something in the code that needs to be changed?

Also, is it possible using the original method, to change the titles for New Products and Featured Products (in the middle of the page, not in the sidebox)?

3 Feb 2008, 11:32 PM
#19
gjh42 avatar

gjh42

Black Belt

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

Re: Trouble changing sidebox title to an image

FYI, one-color text images like yours would be more efficient as gifs than as jpgs. That is the universal standard web recommendation.

Yes, it should be possible to use the same method for the centerboxes. You would probably want to edit /includes/modules/your_template/featured_products.php; if not that, it will have a reference to the file where the title is set embedded in the code.

3 Feb 2008, 11:36 PM
#20
julieoolie avatar

julieoolie

Zen Follower

Join Date:
Jul 2006
Location:
Southern California
Posts:
109
Plugin Contributions:
0

Re: Trouble changing sidebox title to an image

I think they will be changed eventually. I might change the font too..