babyewok Posted June 18, 2010 Share Posted June 18, 2010 I have been scouring the forums for a way to show categories on the homepage, but I have only found a module into which you have to hard code the categories and subcategories which seems a little pointless.I intend to copy the homefeatured module, renaming it homecategories (as I am using the homefeatured mosule, so don't want to override it.) and edit it to show categories instead - I figure this is the easiest way (simply switch from products to categories)?However, I don't know how to edit the files to show categories - so far I just have a duplicate of Home Featured!I want to show the category title, image, description with links to the category and also links to the subcategories. How do I go about this? Link to comment Share on other sites More sharing options...
babyewok Posted June 19, 2010 Author Share Posted June 19, 2010 OK, so I found this module: http://www.quaycreative.com/news/article/category-on-the-homepage-module-free-module-for-prestashop-user/ which shows me how to show the categories with the description. Now the last piece of the puzzle is showing the subcategories (just a simple list of links below each category will do).Any ideas? I have tried all sorts, but I don't really know what I'm doing! Link to comment Share on other sites More sharing options...
babyewok Posted July 20, 2010 Author Share Posted July 20, 2010 STILL, trying to get this sorted! Link to comment Share on other sites More sharing options...
babyewok Posted July 20, 2010 Author Share Posted July 20, 2010 Well at the moment I have abandoned that module to start afresh by copying the blockcategories module. So far, I can add teh top category description by editing category-tree-branch.tpl to simply include this line: {$node.desc|escape:html:'UTF-8'} before this: > {if $node.children|@count > 0} </pre> <ul> now I want to add the image for that main category too. This doean't work: getCatImageLink($category.link_rewrite, $category.id_image,'category-on-home')}" alt="{$category.name|escape:'htmlall':'UTF-8'}" /> so what do I need to do? Link to comment Share on other sites More sharing options...
eGzyl.pl Posted July 21, 2010 Share Posted July 21, 2010 what u need exacly??look here www.prestahelp.comit in polish language but i can tranlsate it to u.if u interested send me pw Link to comment Share on other sites More sharing options...
babyewok Posted July 21, 2010 Author Share Posted July 21, 2010 Thanks, but I'm not looking for a paid module especially since I am 90% there myself. Do you have any suggestions as to what I need to do to get the image showing for the main category? Link to comment Share on other sites More sharing options...
eGzyl.pl Posted July 21, 2010 Share Posted July 21, 2010 Link to comment Share on other sites More sharing options...
babyewok Posted July 21, 2010 Author Share Posted July 21, 2010 Woohoo! Got it working thanks to this thread: http://www.prestashop.com/forums/viewthread/5474/integration/howto_add_category_thumbnails_in_menu_block_I just used this for my image: and changed this bit of code in the module php (based on blockcategories) global $link; $smarty->assign(array( 'categories' => Category::getHomeCategories(intval($params['cookie']->id_lang), true), 'link' => $link )); to this: global $link; $smarty->assign(array( 'categories' => Category::getHomeCategories(intval($params['cookie']->id_lang), true), 'link' => $link, 'homeSize' => Image::getSize('category-on-home') )); I love it when a plan comes together! Link to comment Share on other sites More sharing options...
Susi Posted July 21, 2010 Share Posted July 21, 2010 Hello, that's good to know but now I have a question... how can I use it NOT in the homepage? I've been triyng to make my top menu item "catalogue" to show me a list of the categories... not the empty homepage cat.http://www.editorialrm.comany ideas?Cheers!S. Link to comment Share on other sites More sharing options...
burpitt Posted March 1, 2012 Share Posted March 1, 2012 hmm attempting to do this myself - you think blockcategories is the way forward then? As I'm at the stage of yourself where I have a duped homefeat. and am now looking to get it displaying the mofo'ing cats...! Mind if I have a look at yours to see how its come out and looks onsite? Thanks. EDIT: got a feeling the answer is in this: $category = new Category(1, Configuration::get('PS_LANG_DEFAULT')); Code taken from homepagefeatured.php Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now