Forums / Templates, Stylesheets, Page Layout / Rollover Image Links in Categories Sidebox

Rollover Image Links in Categories Sidebox

Locked

Views: 6,001

Results 1 to 18 of 18
This thread is locked. New replies are disabled.
27 Jun 2006, 3:03 AM
#1
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Rollover Image Links in Categories Sidebox

Hey everyone,

Forgive me, i've been searching for the past two days... the info out there seems to be incomplete. and any helpful past links seem to be broken.

Can someone please help create a tutorial to **replace category links with images and rollovers. ** (for the clients who insist on having their own font for the categories sidebox)

vers. 1.3.0.1

I think it will help so many people... including myself.

thanks so much in advance...

  • pensive612
28 Jun 2006, 5:48 PM
#2
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Rollover Image Links in Categories Sidebox

I'm wondering...is the subject taboo? maybe its' not possible. if not, will one of the experts please just tell me so...

and if it is possible... maybe the specific direction towards it. If I can get it to work, I will gladly write the tutorial.

thank you.

  • pensive612
28 Jun 2006, 6:17 PM
#3
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Rollover Image Links in Categories Sidebox

Is this for just the sidebox headers?

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

28 Jun 2006, 6:38 PM
#4
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Rollover Image Links in Categories Sidebox

no, they actually want the categories to be in a cursive font.

so i need to make slice gif's or jpg's and replace the links with buttons that will send them to the categories...

thanks for looking into it...

  • pensive612
28 Jun 2006, 6:49 PM
#5
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Rollover Image Links in Categories Sidebox

I'm not a graphics expert so I'm not sure how to actually begin to set this up. I think it would be possible but beside the graphics you'd have to modify a couple of template files as well.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

28 Jun 2006, 6:55 PM
#6
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Rollover Image Links in Categories Sidebox

cool. thanks Clyde.

I think i've got the graphics part under control... but knowing the template to modify and the code is the tricky part for me...

thanks again...

  • pensive612
28 Jun 2006, 7:13 PM
#7
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Rollover Image Links in Categories Sidebox

You would create an override file for templates/YOUR_TEMPLATE/sideboxes/tpl_categories.php

In there you would find references to $box_categories_array[$i]['name'] and replace them with something like > zen_image($template->get_template_dir($box_categories_array[$i]['name'] . '.gif', DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . $box_categories_array[$i]['name'] . '.gif', $box_categories_array[$i]['name'])
If you're not using subcategories you could simplify the code in the template and not have to do this three times :smile:.

Kuroi Web Design and Development | Twitter

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

28 Jun 2006, 7:26 PM
#8
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Rollover Image Links in Categories Sidebox

yeah!

thanks Kuroi...

I'm going to try that out today. I'll post to everyone if it works.

  • pensive612
28 Jun 2006, 9:19 PM
#9
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Rollover Image Links in Categories Sidebox

If you want to do rollovers, either via javascript, or the CSS clipping method, you may want to add extra info the <img> tag. Consequently, here is the full schema of the zen_image function> zen_image(image source file name, alt text, width, height, other parameters)For both rollover techniques you would need to set the 5th parameter simply as a string of the relevant inline javascript or inline CSS.

Kuroi Web Design and Development | Twitter

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

29 Jun 2006, 9:30 AM
#10
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Rollover Image Links in Categories Sidebox

Kuroi...

you are the best.

Thank you. It worked perfectly.

Still trying to grasp the rollover part. But your code and idea were perfect. This is the answer...

  • pensive612
21 Nov 2006, 2:18 AM
#11
turtledove avatar

turtledove

Zen Follower

Join Date:
May 2006
Posts:
182
Plugin Contributions:
0

Re: Rollover Image Links in Categories Sidebox

kuroi:

You would create an override file for templates/YOUR_TEMPLATE/sideboxes/tpl_categories.php

In there you would find references to $box_categories_array[$i]['name'] and replace them with something like
If you're not using subcategories you could simplify the code in the template and not have to do this three times :smile:.

For beginners like myself, what does ^^that^^ mean?

30 Mar 2007, 12:23 AM
#12
0101101011 avatar

0101101011

New Zenner

Join Date:
Nov 2006
Posts:
61
Plugin Contributions:
0

Re: Rollover Image Links in Categories Sidebox

Kuroi,
I totally don't get the zen_image example. I have opened a thread couple of days ago, asking simmilar question: I need to replace all categories, subcategories and any other sideboxes text with images (let's skip the 'why?')

I have a jscript which is used in other pages on the site. Here is an html example of rollover image (i.e. navnews.jpg = reg. image; navnews_.jpg = rollover image):

<a href="URLHERE" onmouseover="MM_swapImage('navnews','','icons/navigator/newsc_.jpg',1)" onmouseout="MM_swapImgRestore()"> <img src="/icons/navigator/newsc.jpg" name="navnews" width="97" height="30" alt="articles and news" border="0" /> </a>

I was thinking to incorporate what I need (above) around the code in categories.php, but when I read your post about zen_image, I'm getting lost.

I can't find any explanation to what "$box_categories_array[$i]['name']" means...

I don't understand how this code:

zen_image($template->get_template_dir($box_categories_array[$i]['name'] . '.gif', DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . $box_categories_array[$i]['name'] . '.gif', $box_categories_array[$i]['name'])

applies to the zen_image function - which commas are the separators of the properties? what is the '/' stands for? in which folder the images go to?

And, is there a way to incorporate what I have presented above?
Thanks,

Best,

0100000101011010

---------------------------------
It's not magic, it's just math!

30 Mar 2007, 2:59 AM
#13
0101101011 avatar

0101101011

New Zenner

Join Date:
Nov 2006
Posts:
61
Plugin Contributions:
0

Re: Rollover Image Links in Categories Sidebox

I'm not giving up that easily:

Based on the zen_image function and the replacement code Kuroi have posted:

zen_image(image source file name, alt text, width, height, other parameters)

zen_image($template->get_template_dir($box_categories_array[$i]['name'] . '.gif', DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . $box_categories_array[$i]['name'] . '.gif', $box_categories_array[$i]['name'])

I'm guessing the following:

image source file name = $template->get_template_dir($box_categories_array[$i]['name'] . '.gif', DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . $box_categories_array[$i]['name'] . '.gif'
alt text = $box_categories_array[$i]['name']
width = empty
height = empty
other parameters = empty

  1. Is my logic correct?
  2. How to show the width/height variable then? Is there code for it?

Thanks,

Best,

0100000101011010

---------------------------------
It's not magic, it's just math!

30 Mar 2007, 6:09 AM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Rollover Image Links in Categories Sidebox

0101101011:

width = empty
height = empty
other parameters = empty

  1. How to show the width/height variable then? Is there code for it?Those parameters are optional. If not specified, they default to ... defaults, which typically means the image is displayed in its normal dimensions -- ie: the image is read, the dimensions calculated, and the html that is built to output the IMG tag uses the dimensions read from the image file.
    Thus, there is no need to specify the parameters which were omitted from the example you quoted.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

26 Feb 2009, 5:27 AM
#15
aerografiks avatar

aerografiks

New Zenner

Join Date:
Feb 2009
Posts:
12
Plugin Contributions:
0

Re: Rollover Image Links in Categories Sidebox

Hey guys, first off let me begin by thanking you all for the information and help that has been posted throughout this entire forum. I am at the ends of my wits when it comes down to getting the roll-overs to actually work. I have gotten the images to show up but i still can't manage to figure out how to get the roll-overs to work preferably via css if not js, if anyone could possibly post a ready working script that would be extremely appreciated. Thanks in advance for all my zen contributors. I will be sure to help out as much as i can personally.

27 Feb 2009, 1:35 AM
#17
aerografiks avatar

aerografiks

New Zenner

Join Date:
Feb 2009
Posts:
12
Plugin Contributions:
0

Re: Rollover Image Links in Categories Sidebox

Thanks Misty, but I have installed Category Dressing Mod, and that makes things so much more complex for what i need. I just need to get the roll-overs to work using the method described in this thread. It seems a couple of people have gotten it to work.

30 Apr 2009, 10:17 PM
#18
aerografiks avatar

aerografiks

New Zenner

Join Date:
Feb 2009
Posts:
12
Plugin Contributions:
0

Re: Rollover Image Links in Categories Sidebox

Any help with this issue, anyone???