![]() |
Re: Mod for subcategories in columns with descriptions and icons
I have read through this thread & am a bit confused as to what code I need to use to get the sub-category thumbs to show up. I tried a few different things that were shown here but could not get it to function properly so I restored the original subcategories.tpl file to our site.
Can someone post the latest, functional code again please? |
Re: Mod for subcategories in columns with descriptions and icons
|
Re: Mod for subcategories in columns with descriptions and icons
mrkenzie post #137 does indeed work with v4.1.7. Thank you!
When checking the html output it seems that the table cells are not closed ie: <td>subcategory icon <td>subcategory icon etc. with no closing </td> tags. Anyone know where/how to fix this? FIXED: code: subcategories.tpl: _________________________________________________ {if $subcategories} <table cellspacing="5" width="100%" border="0"> <tr> {foreach from=$subcategories item=subcat} {if $tmp is div by 3} </tr><tr><td colspan="3"></td></tr><tr valign="top"> {/if} { if $tmp and $first_subcat ne "Y" } {assign var="tmp" value=0} {assign var="first_subcat" value="Y"} {/if} <td class="ColumnTitles" valign="top"><a title="{$subcat.description}" href="home.php?cat={ $subcat.categoryid }"><font class="ItemsList">{ $subcat.category|escape }</font><br /><img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_w eb_dir}/default_image.gif{/if}" alt="" /> </a></td> {if $config.Appearance.count_products eq "Y"} {if $subcat.product_count}{ $subcat.product_count } {$lng.lbl_products} {elseif $subcat.subcategory_count}{ $subcat.subcategory_count } {$lng.lbl_categories|lower} {else} 0 Products {/if} {/if} {assign var="tmp" value=$tmp+1} {/foreach} </tr></table> {/if} __________________________________________________ ____ |
Re: Mod for subcategories in columns with descriptions and icons
Quote:
the post on page 14 works (mrkenzie's, post #137 from the link above) for 4.1.8. tested. you just need to save your category icons to the filesystem and not the database. i have yet to see a working code for calling images from the database. you can set where the images are saved thru the images location in your x-cart admin page. hope that helps. i seem to be having an issue with the descriptions though. if i use the wysiwyg mode to type in the description it shows the html tags when you hover over the subcat title. has anyone been able to make it work with wysiwyg mode without showing the html tags? |
Re: Mod for subcategories in columns with descriptions and icons
I actually got it working some time last week. I just have been so busy with modifying the cart & other things at work I did not get back here to post.
Thanks for the help! |
Re: Mod for subcategories in columns with descriptions and icons
I've implemented the code listed on page 14 of this thread and found it to be straight forward to get working. I have, however, noticed that the subcategory description alongside the image is a link (good) with the alt tag being the sub category description (also good) except it displays the <h1> and <\h1> header tags.
Can anyone point me towards where the subcategory description header is formed so that I can use it before the <h1> tags are added? ...or does anyone know how to strip leading/trailing characters from strings? |
Re: Mod for subcategories in columns with descriptions and icons
As has been the case with all my posts I shall now answer my own question:
To remove the header 1 tags from the title of the subcategory links using the code on page 14 I have used the strip_tags variable modifier as follows: Code:
I just love it when code does what you want it to! |
Re: Mod for subcategories in columns with descriptions and icons
How do I get the code below for message 182 to be centered under image?
Please help Jason Quote:
|
Re: Mod for subcategories in columns with descriptions and icons
I have tried the code from post 137 and I see no difference. What could I be doing wrong?
I have ver 4.1.8. I made the changes to skin1.css, include/categories.php, and skin1/customer/main/subcategories.tpl. Uploaded the files, refreshed my frontpage of the store and no changes.... Thanks for the help. |
Re: Mod for subcategories in columns with descriptions and icons
I can't believe it that X-Cart still hasn't fix this "problem" since several release ago.
If someone from Xcart reading this, PLEASE consider getting this added as an option on the next release!!! |
Re: Mod for subcategories in columns with descriptions and icons
2 Attachment(s)
This is for v4.1.8
Thanks to mrkenzie from post #137 for the modifications and the original poster 27stars for the original creation, I got this working on v4.1.8 with just minor modifications. These instructions are basically the same as post #137, but I'll explain it with the code modifications that I have. Mod for subcategories in columns with descriptions and icons for v4.1.8 1. the default "No Image Available" image is displayed if none is assigned 2. product description is displayed below the icon. 3. quantity will display a number in parenthesis and without the word 'product' and "(0)" if there are no subcategories or products for a particular category. 4. and it will also show the subcategory DESCRIPTION if there is one when you hover over the subcategory link. ------------------------------------------------------------ Start by adding this code to the end of the xcart/skin1/skin1.css file. Code:
/* Find the following code in xcart/include/categories.php: Code:
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); Next, find the following code, from <table ..to...</table> in skin1/customer/main/subcategories.tpl and delete it: Code:
<table cellspacing="5" width="100%"> And replace that code with this: Code:
<table cellspacing="5" width="100%" border="0"> And thats it. ------------------------------------------------------------- The default is 3 columns. But 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): 4 column example (two number 3's was changed to 4): Code:
{if $tmp is div by 4} And also change the following line in skin1.css (from above) for the appropriate td width % (4 columns is 25%; 2 columns is 50%; etc.) 4 column example: Code:
.ColumnTitles { To keep the icons aligned evenly on the page , I created my sub-category icons (thumbnails) the same size as the 'No Image Available' image. This size is around 125 x 75 pixels. I've also attached screenshots for the 3 and 4 column displays below. All the modifications above were made on templates that had no previous modifications. Hope you like it and thanks again to 27stars and mrkenzie. - MoonDog - |
Re: Mod for subcategories in columns with descriptions and icons
Anyway to get this to work if the images are in the database?
didn't mean to do that, but had to set it that way to install on this server and forgot to set it back to file system. |
Re: Mod for subcategories in columns with descriptions and icons
Move them back to FileSystem...never should run images from the DB.
|
Re: Mod for subcategories in columns with descriptions and icons
Thanks,
Can I change now or will I have to re-enter all the images for the products? |
Re: Mod for subcategories in columns with descriptions and icons
|
Re: Mod for subcategories in columns with descriptions and icons
Jason,
Did you ever find out how to center the text under the image in subcategories? Thanks, Vahid Quote:
|
Re: Mod for subcategories in columns with descriptions and icons
MoonDog,
You have done an excellent job on this! I have done every thing correct and got the subcategories aligned with picture and text. all great. The only problem I have is that I can’t get the text under the picture in the center. It is on the bottom left side of the image. Any advise. Sorry to have to bother you, I read a lot on the forum with no success. Thanks, V |
Re: Mod for subcategories in columns with descriptions and icons
vahidnia,
Make sure that you have added the following code to your skin1/skin1.css correctly. This is the code that sets your icon and text alignment to center.
Code:
That's it. Hope this helps. - MoonDog - |
Re: Mod for subcategories in columns with descriptions and icons
Apparently, my skin1.css file has no control over subcategort text format and size! . I got rid of this code all together and the text still showed up at the bottom left. I deleted skin1.css in skin1/ directory but again nothing happened. It seems to me that subcategory text gets its format and size from somewhere else! is it possible?
By the way, I am using fancy category mod, does that has anything to do with this? |
Re: Mod for subcategories in columns with descriptions and icons
vahidnia,
Yeah, that seems pretty strange. O.K. let's see, you deleted the .ColumnTitles class and it still does the same thing. Did you check to see that there is only one instance of .ColumnTitles in your skin1.css file. If you have two .ColumnTitles classes, then the last one will overide the first one. But if you do have two of them, just delete one of the two. Now, if there is nothing wrong with your skin1.css file, then go back to the modified skin1/customer/main/subcategories.tpl file and open that up. When your icon gets placed on your page it gets center aligned and then it sees a break tag and then it places the category name text centered on the next line. So if you don't have a <br> tag, then when the text is too long, it goes to the next line, but it continues from the left side instead of the center. So what you need to do is find this line of code: Code:
<td class="ColumnTitles" valign="top"><a title="{$subcat.description}" <a href="home.php?cat={ $subcat.categoryid }"><img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_web_dir}/default_image.gif{/if}" alt="" /><br> Hopefully one of the two will fix it. As far as the fancy category mod, I don't really know what that is. I just bought this x-cart software last month and I'm just playing around with it right now. But I don't think that mod should affect it. But if those two suggestions doesn't work, then I guess maybe it could. Well, that's it. Good luck. - MoonDog - |
Re: Mod for subcategories in columns with descriptions and icons
I checked both. there is only one ColumnTitles in skin1.css file (at the end of the page) and <br> tag was already there.
If i could find how i could change the text size of the subcategories i would have been able to fighure that out. Any advise on that? Thanks for your time, V |
Re: Mod for subcategories in columns with descriptions and icons
vahidnia,
Search for this code in the skin1/skin1.css file. This is what your looking for to change the font styles of the subcategories. Code:
Example: you want to change to font size to 16 px. All you do is insert this code: Code:
FONT-SIZE: 16px; into the .ItemsList class above. So that your code will now look like this: Code:
And that's it. - MoonDog - |
Re: Mod for subcategories in columns with descriptions and icons
I told you my skin1.css file has no control over anything! It was skin1_c.css! can you believe that! :D/
Thanks for your help MoonDog! |
SOLUTION: Centering subcat name under photo || Mod for subcategories in columns
DIV is block-level. text-align does not center a DIV. The correct way to horizontally center a DIV is to use "auto" attribute, like so:
margin:0 auto 0 auto. Tested. This will get you what you want: .ColumnTitles { TEXT-ALIGN: center; WIDTH: 33% PADDING-LEFT: 5px; margin:0 auto 0 auto; } |
Re: Mod for subcategories in columns with descriptions and icons
I have the mod working for my version (see below). However, the thumbnail placement, according to the division, is not good.
I have: 15 subcategories (in one category) code set for 3 columns, colspan=3 Displays as 4 images on first row 3 images on 2nd, 3rd, 4th rows 2 image on last row Rather than 3 items on each row. Any ideas how to (scalably) force this? |
Re: Mod for subcategories in columns with descriptions and icons
Moon Dog (and 27stars and mrkenzie) - thank you so much!!! Your instructions were simple, easy and worked perfectly!!! I really appreciate you taking the time to share this mod!
|
Re: Mod for subcategories in columns with descriptions and icons
I cant get the images to show up. I have category icons, and detailed product images set to file system and product thumnails set to db and I think thats my problem. When I try to chang it, file system is in red lettering and I get this
Images transferring log ************************************************** ******************** LOG CREATED: 2007-10-16 19:31:16 Category icons Location: FS no images are found Product thumbnails Location: FS Product detail images Location: FS no images are found ************************************************** ******************** LOG CREATED: 2007-10-23 11:28:32 Product thumbnails Location: FS |
Re: Mod for subcategories in columns with descriptions and icons
thanks for the Mod, but my text will not center also
|
Re: Mod for subcategories in columns with descriptions and icons
aerogear2000,
Post #218 describes what you need to do in order to center the text. The code should be placed in your skin1.css file. And if that doesn't work, then check to see what css file you are using and place that code into the css file that you are using. If you have a skin1_c.css file then add it to the bottom of that file. This should take care of the problem. - MoonDog - |
Re: Mod for subcategories in columns with descriptions and icons
I have the mod working for my version (see below). However, the thumbnail placement, according to the division, is not good.
I have: 15 subcategories (in one category) code set for 3 columns, colspan=3 Displays as 4 images on first row 3 images on 2nd, 3rd, 4th rows 2 image on last row Rather than 3 items on each row. Any ideas how to (scalably) force this? __________________ XCart Gold 4.1.3 Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12 OpenSSL/0.9.6b PHP/5.0.3 mod_perl/1.27 Reply With Quote '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''' Same problem here. Any suggestions? Bryan |
Re: Mod for subcategories in columns with descriptions and icons
thanks mod work great
|
Re: Mod for subcategories in columns with descriptions and icons
Mod is great! Works in 4.1.5, too! :) Thanks!
|
Re: Mod for subcategories in columns with descriptions and icons
Thanks very much for this great mod, I am new to X-Cart and got it working in a couple of minutes!
Only thing that took some time was aligning text and thumbnails correctly. I read that more people were encountering this problem, the solutution for me was very simple. When you place the new code in skin1.css be sure to place an enter (blank line) above the /* Kind regards, JJ |
Re: Mod for subcategories in columns with descriptions and icons
This is an awsome mod...works perfect in 4.1.9 that is modified quite a bit....super job...
|
Re: Mod for subcategories in columns with descriptions and icons
|
Re: Mod for subcategories in columns with descriptions and icons
any pictures we enter in the sub catagories will appear also
|
Re: Mod for subcategories in columns with descriptions and icons
did you find a solution to this as I am having the same issue.
thanks Quote:
|
Re: Mod for subcategories in columns with descriptions and icons
Quote:
Version 4.1.9 WORKS PERFECT THANKS MOON DOG !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!WOOOOO HOOOOOOO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!! |
Re: Mod for subcategories in columns with descriptions and icons
Moon Dog,
It works great except I get a dotted line around each item. Any way to change that? Thanks! Happy 2008! |
Re: Mod for subcategories in columns with descriptions and icons
Hi Vera,
I was a little confused here, but I think you were referring to another post which is the 3 column layout with thumbnail for Related Products where I posted a modified related_products.tpl file. I've added to that post as to how to change the dashed border around the products. Just click on the link above and it should take you there. - MoonDog - |
All times are GMT -8. The time now is 07:22 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.