Hello,
Upon a customer request, I decided to write this. As time passes, I still come up with functions I don’t know CB has and are useful. This time, we will use the function get_cat_thumb(). The function is in category.class.php. This function can be found in the whole v2 branch.
1. Open the .html page where you would like the thumbnail to appear. You can use index.html, for example.
2. Paste the following code:
{assign var=CatThumb value=$CBCategory->get_cat_thumb(array("category_id"=>$idofcategory))}
You need to replace $idofcategory, either with the variable that contains the category id or with the id number of the category. (“category_id”=>14 .. if category_id is 14)
3. To show the thumbnail use the following code:
{$CatThumb}
4. Save and Upload.
That’s it! If for any reason it doesn’t work for you, please do not hesitate to contact me so we can work it out together. Any questions, comments or article suggestions are welcome.
Best Regards,
Richi
Looking for quality ClipBucket Hosting? Look no further than Arvixe Web Hosting!
Hey Richi,
I’m trying to use this on our site but on the page I use it on I’m getting the error below:
Fatal error: Smarty error: [in /home/cbchigh/public_html/styles/cbv2new/layout/index.html line 113]: syntax error: invalid attribute name: ‘=’ (Template_Compiler.class.php, line 1548) in /home/cbchigh/public_html/includes/templatelib/Template.class.php on line 1095
Any ideas what would be causing this? (the line of code it’s pointing to is this same line of code you give in your example) Thanks for your help and all of the info you put out there.
Hello,
Thanks for your comment. What CB version are you running?
Regards,
Richi
version 2.6
Hello,
Could you please create a thread at our forum (forum.arvixe.com) to further investigate this?
Regards,
Richi