![]() |
Category Pics instead of text
Hey everyone,
I was wondering if anyone had any thoughts or ideas on how to set this up. Instead of displaying the category text, I was thinking about displaying a graphic instead. I guess there are a couple of ways of going about this, I was thinking of creating another column in the xcart_icons table, and inserting the gif for each category that way, then pulling the gif from the database through the smarty tags. Does anyone have any other ideas about this? Does anyone have this implemented in their x-cart configuration? -Mike |
Hey Mike,
Have you looked at the fancy categories from x-cart? |
just an update
Here is what I did to add a category icon instead of using the text for categories.
I created another field in xcart_categories table using phpmyadmin. I called it: category_image Type=VARCAR (255) I set it to NULL. Then I just edited the table through phpMyAdmin and for each main category I added: yourwebsite.com/store/files/Fulfillment staff/product_images/WhateverYouWant.jpg (This is where I store my images for X-Cart). Then in categories.tpl Between the {section name=cat_num loop=$categories} and {/section} I added this line Code:
{$categories[cat_num].category_image} I know there are probably other ways of doing this, and there are probably posts on this, I didn't even check :oops: Hopefully someone might find this useful, I imagine you can use this for the subcategories too, just modify the loop for subcategories. PLEASE if there are any errors or comments, POST IT- I just started using X-cart about 2 months ago or something so I am not an expert by any means. Mike |
Re: Fancy Categories
No I did not actually, I didn't even think of that. I was just looking for a quick solution and this is the only one I could think of :)
There's another solution: fancy categories The reason I didn't use fancy categories is because I have my subcategories displaying the whole time someone is browsing in their parent category. From what I saw with the x-cart default setup, the subcategories disappear when you click on one of them, I didn't like that so I had some mods done to keep the subcategories visible until the customer switches main categories. -Mike |
code posted below, which is what i used for doughtysonline.co.uk
|
I love the way it works, and the way it looks. I just am concerned about how well it does with search engines. It would be great if you could post the code.
Eduardo. |
OK, the search engines should be fine as the categories list is text and not graphic although it looks like it.
If you include the categories in your keywords the search engines should pick up on them as well as the text on the rest of the pages and as the categories list is an embedded template, they will display the url of the whole page and not just the menu. Hope that answers your question! Code below, I have left out the images that I have used and put in their place captions to help you place your own images - to keep in line with look and feel of your site... Just change the YOURIMAGE.GIF to whatever image you want to use... Replace customer/categories.tpl with this: Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> and then create a file in xcart/include called categories.php and paste in this code: Code:
<? Menu only supports 1 level of subcategory, that's the only drawback. Love & Respect to to cartlab.com for the original code. |
freshkit,
Could there be something missing here? When I use it, it allows me to drop down, but no subcategories are there. Eduardo. |
That's as it is on the site, my subcategories work ok.
Give me URL to your site and I'll have a look and see if I can identify what's wrong. |
Quote:
Do you have any subcategories currently? This works beautifully for me except that where I don't have subcategories, there is no way to get to the top menu products. Is there a fix for this? You can see here what its doing: http://www.cripps-medical.com/customer/home.php?cat=246 If you click "Sport", there isn't any sub categories, and therefore no way to see the products for this category. |
All products need to go into subcategories to be viewed.
If you do put products into the main category though, whilst not visible to the customer, they can be useful as you can put products into those sections which are intended to be sold with other items and not seen by the customers on their own. For example: I'm doing a promotion on a Plasma TV with бё500 worth of free home cinema accessories. Because I have put the products on for free, I don't want them to be seen and have to give them to just anyone! So I have put them in one of the main category sections so that X-Cart can pull them in from this category when setting up the 'extra product options' fields for the Plasma TV, in order for it to display the free products as a series of 'options' in a dropdown menu to the customer. |
Gotcha. Thanks!
|
donavichi,
Nice site you have there, might even be tempted to buy something at some point in the future! I don't suppose you have the menu code available to put on a non-x-cart site? I'm doing a lot of brochure type sites at the moment, and that menu is just what I've been looking for! Cheers Dave |
Thanks very much.
I'm afraid I don't but have you checked out http://www.hotscripts.com/JavaScript/Scripts_and_Programs/Navigation/Menus/index.html this is a good place to look for dHTML menus and cool java type stuff! Regards, Don - freshKIT |
Re: just an update
Hello.
I would like to do what Mike told us in first three post of this thread(Text to graphic categories). My server has phpMyadmin installed and I created field called category_image(Type=VARCAR (255) I set it to NULL.) in xcart_categories table. But then I don't know what to do next. How, where do I specify the location of images for each categories? Do I need to put some script in somewhere? I'm no good with MySQL database. I would appriciate little help here. Thank you. Quote:
|
We used a modified version of this code on www.cripps-medical.com. It works great for them since they have sooo many subcategories.
We are still working on the site; it doesnt' yet view properly in some browsers FYI. Should have those kinks worked out by this weekend. Thanks again! |
I know this is an old post but this menu is just what I'm looking for. Doesn't quite work for the 4.0.12 cart I'm using now. I basically lists all the categories with the subcategories as well. Was wondering if someone could look at the code and see what needs to be altered for this newer version.
|
Re: just an update
I'm going to join in the ressurection of this one
I've done as suggested with the extra table in xcart_categories and entered image location in the new table for each of the categories. Then edited categories.tpl as follows line in question: Code:
<FONT class="CategoriesList">[img]{$categories[cat_num].category_image}[/img]{$categories[cat_num].category}</FONT> complete file: Code:
{* $Id: categories.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} I've left the text links in for now, intending to remove them later and perhaps use a similar table trick to pull alt text for each button for SEO problem is, instead of calling the image location, I'm just getting as imahe location '/home.php' Am I trying to call the image incorrectly, or does it suggest a problem with the way I have set up the table? (table contains the absolute url to the image) Quote:
|
All times are GMT -8. The time now is 07:37 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.