Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

amazon-style tabbed menu for 4.0.x

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 01-22-2005, 03:47 PM
 
jdedba jdedba is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 96
 

Default

Ok, I found my problem. I am not sure what .order_by presents, but if I change 10 to 50 or comment the below line out, the main categories shows up on the tab.

Code:
{if $categories[cat_num].order_by lt 10}

So, if there are too many categories, the tab will be too wide. Can put the menu into two rows?

I am still trying two problems:

1. If I want to add an additional tab to the menu, the color change will not be right. For example, add below line to the tab_menu.tpl

<TD align="center" class="tabmenuitem" nowrap><span>Test</span>
</TD>

2. Once I click on a subcategory, the red color on the text of subcategroy will be kept. I guess it can be fixed by css file, but donot know how yet.

Thanks again.

Jeff
__________________
version 4.1.1
Reply With Quote
  #12  
Old 01-25-2005, 02:02 AM
 
steveparks steveparks is offline
 

Advanced Member
  
Join Date: Jan 2003
Location: UK
Posts: 87
 

Default explanation

Just to clarify to everyone:

1. Order_by
order_by is the numeric value that you can assign to each category from the admin area in x-cart. That value determines in which order the categories appear in the category menu.

Because you don't want there to be too many tabs in the tab menu, I've set it so that only Categories with an order_by of less than 10 will show up in the tabs - that way you can have only your most important categories on this key menu...and the rest on the side menu.

To decide which tabs appear in your tab menu, simply log in to your admin area, select 'Categories' from the menu on the left, and assign values of less than 10 to the categories you want to appear in the tab menu. They will appear in order of these numbers, so give the ones you want to be further on the left the lowest number.

This provides a simple method for you or your customers to control the tab menu without delving into code all the time.

Adding more tabs
The tabs (except the 'home' tab) are added dynamically from your category structure. You do not need to add any more code to add more tabs. Just give the categories an order_by value of less than 10.
If you really want to add more tabs to static pages or similar then you can do this in the code, but i'd advise having this on the speedbar, so that you can easily change or update them from the admin area. You can change the look and feel of the speedbar easily (see other posts in these forums), see www.redleader.biz/xcart/home.php (my development site) for an example.

[/b]
__________________
--------------
RHEL3/Apache2/PHP4/MySQL4/Plesk7.5.3
X-Cart 4.0.16 - Live
X-Affiliate
X-AOM
ez-checkout
ez-upsell
--------------
Reply With Quote
  #13  
Old 01-27-2005, 11:05 PM
 
Danielle Danielle is offline
 

Senior Member
  
Join Date: Jan 2005
Posts: 138
 

Default

I tried to implement this, but there was a square background behind the tab that matched whatever color I used on the tab itself. How do I get rid of that? Also, can I do it like on this site? www.wholefamilymarket.com? I really like how theirs are, and that is the kind of info I wanted on my tabs, I don't really want product categories, I just want them to be for additional info.

Thanks!
__________________
Danielle
X-Cart Pro 4.0.10
X-Gift-Registry
X-AOM
Reply With Quote
  #14  
Old 01-27-2005, 11:49 PM
 
steveparks steveparks is offline
 

Advanced Member
  
Join Date: Jan 2003
Location: UK
Posts: 87
 

Default Speed bar

Hi Danielle

It looks like they've just moved the speed bar, which is simple enough to do (search for 'speedbar' on this forum), then you can set what the tabs are from the admin backend.

Re: the square edges you're getting. it does seem to be a problem that IE doesn't load the corner images quickly enough. If you hold the mouse over a tab for a little bit, it will then load thee image, and it will be fine after that.
Anyone got any ideas for a workaround for this? Firefox handles it absolutely fine.

I have one idea which is to load the rollover images into the page on the page loading, with them just being allowed dimensions of 1x1. then IE should have them cached.
I'll try this over the weekend.
steve
__________________
--------------
RHEL3/Apache2/PHP4/MySQL4/Plesk7.5.3
X-Cart 4.0.16 - Live
X-Affiliate
X-AOM
ez-checkout
ez-upsell
--------------
Reply With Quote
  #15  
Old 01-28-2005, 05:58 AM
 
aaron aaron is offline
 

Newbie
  
Join Date: Dec 2004
Posts: 7
 

Default different image for each category?

This is a nice mod, good job.

I am wondering if it is possible to add to it, what I am hopeing for is to have a unique image for each category (category icon), something that can be used in place of the text (then with the text as the alt tag)

Right now, as we are developing our store, we making a static menu across the top with a different image/rollover for each category. A dynamic category list like this would be more practicle, if we need to deactivate a category, we dont have physically remove the link,etc.

Would this be possible with this mod, or is there another mod that can accomplish this?

Thanks
__________________
x-cart v4.0.8 [unix] Installed at Tic Toc Tea Not active

Tea Forum Forum about Tea
Paintbox Productions Creative Productions Website
Reply With Quote
  #16  
Old 01-28-2005, 06:23 AM
 
Danielle Danielle is offline
 

Senior Member
  
Join Date: Jan 2005
Posts: 138
 

Default

Hmmm nope mine never became rounded. You could see the rounded image over top of the square image. Whatever color I changed the tab too, that changed the background behind it. The square edges did not ever disappear.
__________________
Danielle
X-Cart Pro 4.0.10
X-Gift-Registry
X-AOM
Reply With Quote
  #17  
Old 01-28-2005, 10:21 AM
 
steveparks steveparks is offline
 

Advanced Member
  
Join Date: Jan 2003
Location: UK
Posts: 87
 

Default browser?

Hi Danielle

Could you let me know what OS, browser etc you were viewing it on please? I'll see if i can work out what was going on.

anyone else had this problem? anyone else got it working ok?

cheers
steve
__________________
--------------
RHEL3/Apache2/PHP4/MySQL4/Plesk7.5.3
X-Cart 4.0.16 - Live
X-Affiliate
X-AOM
ez-checkout
ez-upsell
--------------
Reply With Quote
  #18  
Old 01-28-2005, 10:25 AM
 
Danielle Danielle is offline
 

Senior Member
  
Join Date: Jan 2005
Posts: 138
 

Default

Hi, I am using Windows XP, IE6.

Thanks!
Danielle
__________________
Danielle
X-Cart Pro 4.0.10
X-Gift-Registry
X-AOM
Reply With Quote
  #19  
Old 01-28-2005, 10:30 AM
 
steveparks steveparks is offline
 

Advanced Member
  
Join Date: Jan 2003
Location: UK
Posts: 87
 

Default Images instead of text

Hi Aaron

What you want is possible.

In the code I posted above, look for:

Code:
{section name=cat_num loop=$categories} {if $categories[cat_num].order_by lt 10} {if $cat eq $categories[cat_num].categoryid} <TD align="center" class="tabmenuitemon" nowrap><span>{$categories[cat_num].category}</span> </TD> {else} <TD align="center" class="tabmenuitem" nowrap><span>{$categories[cat_num].category}</span> </TD>

Then within each of the two TD tags, you will see:
Code:
{$categories[cat_num].category}

Change this (in both cases) to be:
Code:
[img]/CatIcons/{$categories[cat_num].category}.gif[/img]

Then create icons with exactly the same names as your categories, in a folder called CatIcons in the root directory. You can of course choose to use a Smarty variable to give the directory, and this would be best practice, but i use the directory above to illustrate.

You can also change what the images are called, so you could use categoryid or order_by or similar by changing the code above and the image name.

You can even tweak the code to have different images for whether a category is active or not.

cheers
steve
__________________
--------------
RHEL3/Apache2/PHP4/MySQL4/Plesk7.5.3
X-Cart 4.0.16 - Live
X-Affiliate
X-AOM
ez-checkout
ez-upsell
--------------
Reply With Quote
  #20  
Old 01-28-2005, 10:34 AM
 
steveparks steveparks is offline
 

Advanced Member
  
Join Date: Jan 2003
Location: UK
Posts: 87
 

Default XP IE6

Hi Danielle

I have IE6 and XP, and i can't seem to recreate the problem....they're just slow to load but they do appear.

Could you try out my development site, and see if you have the same issue with the tabs there please?
http://www.redleader.biz/xcart/customer/home.php

Thanks
Steve
__________________
--------------
RHEL3/Apache2/PHP4/MySQL4/Plesk7.5.3
X-Cart 4.0.16 - Live
X-Affiliate
X-AOM
ez-checkout
ez-upsell
--------------
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:54 AM.

   

 
X-Cart forums © 2001-2020