iant Posted October 24, 2009 Share Posted October 24, 2009 Hi,When you click a category the subcategory pictures display then when you click the subcategory picture the products are listed with the subcategory picture at the top of the listings. Is there anyway to remove the picture at the top of the subcategory listings??If i don't use a subcategory picture at all then nothing displays, but as soon as i pop a picture in it displays.How can i remove the subcategory picture from the top of the listings but have the picture remain on subcategory listings in the categories??ThanksIan Link to comment Share on other sites More sharing options...
rocky Posted October 24, 2009 Share Posted October 24, 2009 Modify category.tpl in your theme directory and {* comment out *} the <!-- Category image --> section. 1 Link to comment Share on other sites More sharing options...
iant Posted October 25, 2009 Author Share Posted October 25, 2009 Hi Rocky,Thanks for your replyIf i comment out the following<!-- -->Yes it works, however it also removes the subcategory pictures under category, I want the subcategory pictures under category to remain, I just to remove subcategory top picture from the listings under subcategory??I hope that makes sense.ThanksIan Link to comment Share on other sites More sharing options...
rocky Posted October 25, 2009 Share Posted October 25, 2009 I think you commented out the wrong code. You should comment out the code further up instead. Replace: <!-- Category image --> {if $category->id_image} <img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" /> {/if} with: {* <!-- Category image --> {if $category->id_image} <img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" /> {/if} *} Link to comment Share on other sites More sharing options...
iant Posted October 25, 2009 Author Share Posted October 25, 2009 Hi Rocky,Spot on, that did the trick.Many ThanksIan Link to comment Share on other sites More sharing options...
wiros Posted March 20, 2010 Share Posted March 20, 2010 Hmm, I tried his, but I don't see a different. I like to remove images in the Subcategory, not from the category. Am I doing something wrong? Link to comment Share on other sites More sharing options...
rocky Posted March 20, 2010 Share Posted March 20, 2010 The code above only removes the category image. If you want to remove the subcategory images, you must {* comment out *} the following lines 30-37 of category.tpl: <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}"> {if $subcategory.id_image} <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" /> {else} <img src="{$img_cat_dir}default-medium.jpg" alt="" /> {/if} </a> 2 Link to comment Share on other sites More sharing options...
wiros Posted March 20, 2010 Share Posted March 20, 2010 That it! Thnx Link to comment Share on other sites More sharing options...
rusty Posted May 10, 2010 Share Posted May 10, 2010 I have a similar delima...I only want subcategories with images to show the images and those without images will be bullet listed.Here is my code: {l s='Subcategories'} {foreach from=$subcategories item=subcategory} {if $subcategory.id_image} getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}"> getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" /> getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'} {else} getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'} {/if} {/foreach} The issue im having is it still is only showing the no-bg class on all my subcategories even though they have no image applied to them. Link to comment Share on other sites More sharing options...
nutt318 Posted June 2, 2010 Share Posted June 2, 2010 Rusty, Did you ever figure this out? I am wanting to do the same thing, if there is not an image for something than just have it be a bullet list.Thanks. Link to comment Share on other sites More sharing options...
rusty Posted June 2, 2010 Share Posted June 2, 2010 Rusty, Did you ever figure this out? I am wanting to do the same thing, if there is not an image for something than just have it be a bullet list.Thanks. Yup here is my code {if isset($subcategories)} <!-- Subcategories --> {l s='Choose A Sub Category'} {foreach from=$subcategories item=subcategory} 0}class="no-bg"{/if}> {if $subcategory.id_image>0} <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}"><img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" /></a> {/if} <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}</a> {/foreach} {/if} Then use css to control your lists with the 'no-bg' class for images without bullets. Link to comment Share on other sites More sharing options...
nutt318 Posted June 2, 2010 Share Posted June 2, 2010 Rusty, Thanks for the code. Anyways I added that to my themes category.tpl and now when i go to refresh my page im getting the following. * getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">2003 * getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">2004Any Ideas?Thanks,Jake Link to comment Share on other sites More sharing options...
rusty Posted June 2, 2010 Share Posted June 2, 2010 Rusty, Thanks for the code. Anyways I added that to my themes category.tpl and now when i go to refresh my page im getting the following. * getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">2003 * getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">2004Any Ideas?Thanks,Jake Looks like some of the code was removed when I posted it...must be filtering the html I have attached the code in a text file.code.txt Link to comment Share on other sites More sharing options...
nutt318 Posted June 2, 2010 Share Posted June 2, 2010 That worked perfect rusty, thanks for the help. Link to comment Share on other sites More sharing options...
rocky Posted June 2, 2010 Share Posted June 2, 2010 The forums automatically strip <a>, <img> and <script> tags. I fixed your code above by changing them to <a> and <img>. Link to comment Share on other sites More sharing options...
pcitshop Posted December 29, 2011 Share Posted December 29, 2011 What if i want to show categories and sub categories on left column only and not on the centre page? Link to comment Share on other sites More sharing options...
Ron morales Posted December 11, 2012 Share Posted December 11, 2012 {if $subcategory.id_image} {if $subcategory.id_image>0}<img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />{/if} {else} <img src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {/if} with this code work Link to comment Share on other sites More sharing options...
mrjan Posted April 3, 2015 Share Posted April 3, 2015 Hello, I would like to have Category Picture narrower, e.g. 217x217px, so not so wide like original is. When I remake new pictures, new picture fill the whole width, so it looks not nice. Thank you for help. Link to comment Share on other sites More sharing options...
Recommended Posts