This works for me to get multiple row categories with icons in 4.1.1. My use doesn't need text or descriptions, so you'll have to add that back if you do. Still needs some cleaning up, but it works. This is just a snip from the template.
Code:
{if $subcategories} |
Close, but use the file system for the cat. images. The code needs to be reworked using sections to allow for multiple columns (am trying it now), but here's your previous code with names and content and using the file system. I have left your database image call to see what was coded out...
Code:
{if $subcategories} |
This is a great mod! I've got an idea for an addition and two questions:
First, I've made the Icon/Category one link, instead of two on top of each other... no big deal. I've also added a title tag to the link, though, so when someone hovers, there can be text... this seems like it should be good for adding keyword density to the link. The problem is, I can't find the smarty tag for the category description, which is, in my opinion, highly appropriate for the title tag. If you can tell me the tag, I'd be very grateful. Second, when a category has no products, there is nothing beneath the Category name. Is there a way for it to say "0 Items" instead of it being blank? Here's my subcategories.tpl: Code:
{* $Id: subcategories.tpl,v 1.43.2.2 2004/10/07 07:08:51 max Exp $ *} Jeremy |
Oh, does anyone know what tag to add so (0 Items) appears when there are no items in a subcategory? Right now, (# Items) only shows up if the subcategory actually has items available.
Thanks, Jeremy |
Code Modified for use with DSEFU
Hey guys, I just got the code working with DSEFU's , v 4.0.17 Pro and figured it would be of use here since both seem to be a popular mod and I had seen at least one request in this thread.
Notes: * This is the entire code for subcatecories.tpl * Modified per Balinor's post on page 8 to use file system for images instead of a call to the database * This code uses 4 columns. You have to set n in "div by n" to the (number of columns + 1). I also changed the width of the table to work with four columns, thus the "25%". Just change that value to the appropriate number for your number of columns (33% for 3, 20% for 5, etc). * I used an image height of 50, so you may need to change that to your needs as well. Thanks for this mod, it's definitely a good one. And thanks for this forum in general. I've found lots of good stuff here and figured I'd give something back with this post. Code:
{* $Id: subcategories.tpl,v 1.43.2.2 2004/10/07 07:08:51 max Exp $ *} |
Quote:
Did you ever make any progress on this? Thanks |
This is the code that I have and works with 4.1.0. I have added several things to this modification. Not only will it display the categories in columns, it will:
1. display the default "No Image Avail." image if one is not assigned 2. display "0 Products" if there are no subcategories or products for a particular category. 3. it will show the subcategory DESCRIPTION if there is one when you hover over the subcategory link. Take it, use it, modify it. Good luck! Here is what you add to the Skin1.css Code:
.ColumnTitles { padding-left: 5px; text-align: center; width: 33%; } Find this in categories.php: Code:
$_categories = func_query_hash("SELECT $to_search FROM $sql_tbl[categories] USE INDEX (am) $join_tbl ".(!empty($search_condition)?"WHERE ".implode(" AND ", $search_condition):"")." GROUP BY $sql_tbl[categories].categoryid ".$sort_condition, "categoryid", false); and replace with this (in order to get the category description): Code:
$_categories = func_query_hash("SELECT $to_search, $sql_tbl[categories].description FROM $sql_tbl[categories] USE INDEX (am) $join_tbl ".(!empty($search_condition)?"WHERE ".implode(" AND ", $search_condition):"")." GROUP BY $sql_tbl[categories].categoryid ".$sort_condition, "categoryid", false); Here is the code that I changed in subcategories.tpl: Code:
{if $subcategories} By Default, it shows 3 columns. If you want to change the number of columns, then just change all the 3's to the number of columns you want in this line of code (from above): Code:
{if $tmp is div by 3} Code:
.ColumnTitles { padding-left: 5px; text-align: center; width: 33%; } I added a blank row between each row of subcategories, just to seperate the rows a little so it does not look so crowded. Let me know if there are any problems. |
Excellent! Works fine in 4.1.2!
Thank you, Louise |
Right on, I've been waiting a while for someone to get the right code, thanks a lot Mike, it works great on 4.1.2 :)
|
Thanks Mike. Works beautifully and a great sign that the forum will commence it's move to supprting 4.1.x users....
- Mike |
All times are GMT -8. The time now is 01:16 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.