albertrivero Posted December 31, 2014 Share Posted December 31, 2014 Hello, I'd like to maintain the pictures of all the subcategories but when entering one, not seeing the pic (as it doesn't fit very well). I've tried to edit the element.style with no succes... See pics: (Click to enlarge) Many many thanks in advance Link to comment Share on other sites More sharing options...
vekia Posted January 2, 2015 Share Posted January 2, 2015 hello what you exactly expect now? you want to remove these images? (DELETE on your image) or just want to fix the appearance of the category name below the image? can you share url, please ? 1 Link to comment Share on other sites More sharing options...
albertrivero Posted January 2, 2015 Author Share Posted January 2, 2015 (edited) I'd like to delete only the picture inside the category. But the page in which all categories are shown (see pic 1) I'd like to keep the pics. I've tried to delete directly the picture but now instead of the picture it appears a picture with a "?" as you can see in picture 2. I'd like to remove this "'?" basically. and keep the pictures in the general overwiev of all categories. I cannot provide the link as the store used to be online and I don't want the customers to be able to enter... Nor want to change it from folder... hehe & I don't want to put it in catalog mode Thanks hello what you exactly expect now? you want to remove these images? (DELETE on your image) or just want to fix the appearance of the category name below the image? can you share url, please ? Edited January 2, 2015 by albertrivero (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted January 9, 2015 Share Posted January 9, 2015 If I understand you well, you just don't want the category image: Edit themes/<your theme folder>/category.tpl (make backup!) Find this piece of code (Code sample of PS 1.6.0.9. Your version may differ a little): <!-- Category image --> <div class="content_scene_cat_bg" {if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) right center no-repeat; background-size:cover; min-height:{$categorySize.height}px;"{/if} > change into: <!-- Category image --> <div class="content_scene_cat_bg"{* {if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) right center no-repeat; background-size:cover; min-height:{$categorySize.height}px;"{/if} *}> (After saving changes, temporarily change smarty options (in Back Office->Advanced Parameters->Performance) to: force compilation and cache = OFF to see the results. (Change back to original state afterwards, otherwise your site sloooooows down considerably!) Hope this is what you needed, pascal. 2 Link to comment Share on other sites More sharing options...
kaitzu Posted February 18, 2015 Share Posted February 18, 2015 Someone perhaps can tell me how to change that code if I´d like to show category image only when it exist, if image not exist then just show the name of category.This I´d like to do because I´d like to show only some category images, not all images or no images at all.I have thousands categories so its very big job to find out some own picture for each category. Link to comment Share on other sites More sharing options...
PascalVG Posted February 21, 2015 Share Posted February 21, 2015 Kaizu, The code of 1.6.0.9. seems to do that already. {if $category->id_image} <- Test if image is defined ... code to display image. {/if} What version do you use? pascal Link to comment Share on other sites More sharing options...
kaitzu Posted February 23, 2015 Share Posted February 23, 2015 Kaizu, The code of 1.6.0.9. seems to do that already. {if $category->id_image} <- Test if image is defined ... code to display image. {/if} What version do you use? pascal Sorry, version is 1.6.0.9 Problem is if there isn´t any image for subcategorie then shop will show question mark "image" and it will show of course the name for categorie. But I in those cases where image not exist then need to show only the name of categorie, this was the point what I try find out. I have made a solution like this, I changed some code and removed the border from subcategorie image I made a blank transparent image I will add this transparent image for all those categories where I don´t have exact picture. This isn´t best solution but it works for now on... Link to comment Share on other sites More sharing options...
PascalVG Posted February 24, 2015 Share Posted February 24, 2015 To do it without making the transparent image: in themes/<your theme folder>/category.tpl, find the following code and add the red code: (code sample from PS 1.6.0.8) (Make backup first, just in case!) <!-- Subcategories --> <div id="subcategories"> <p class="subcategory-heading">{l s='Subcategories'}</p> <ul class="clearfix"> {foreach from=$subcategories item=subcategory} <li {if $subcategory.id_image && !is_numeric($subcategory.id_image)} class="subcat_no_border" {/if}> <div class="subcategory-image"> <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}" title="{$subcategory.name|escape:'html':'UTF-8'}" class="img"> {if $subcategory.id_image && is_numeric($subcategory.id_image)} <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {else} <div class="replace-2x" style="width:{$mediumSize.width}px;height:{$mediumSize.height}px;" /></div> {* <img class="replace-2x" src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> *} {/if} </a> </div> and save the file. Then remove the border from the subcategory images: Edit file: themes/<your theme folder>/css/category.css, around line 58: (Make backup!) #subcategories ul li .subcategory-image a { display: block; padding: 9px; // border: 1px solid #d6d4d4; <-- out-comment this line to remove the border } // N.B. keep the closing bracket. Push it to a new line! and add following code (at end of file) to remove the thick border box when hovering over the (now non existing) image. Clicking here is still possible, and will go to the sub category, as before) #subcategories ul li.subcat_no_border:hover .subcategory-image a { border:0; padding: 8px; // added to show little 'activity' (click still possible on old image location) } save and reload the category page. You will see this: Hope this helps, pascal 1 Link to comment Share on other sites More sharing options...
kaitzu Posted February 24, 2015 Share Posted February 24, 2015 Its working! Link to comment Share on other sites More sharing options...
NNGNews Posted March 9, 2015 Share Posted March 9, 2015 Instead how to don't show at all the subcategories images ? We don't have them, but when the "root" category is selected, the page shows the subcategories with a blank square with "NO IMAGES .." for each subcategory. We would like to show only text. In category.tpl we have "deleted" this sentences <!-- div class="subcategory-image"> <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}" title=" {$subcategory.name|escape:'html':'UTF-8'}" class="img"> {if $subcategory.id_image} <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {else} <img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {/if} </a> </div --> but now we don't have anymore that images but the space is the same, in few words he have a lot of space between each row of subcategory like there still are images although they're not shown. I'm not fond on HTML what should I delete more ? Thank you Link to comment Share on other sites More sharing options...
PascalVG Posted March 10, 2015 Share Posted March 10, 2015 Hi NNG, do you have a link to your site, then we can give you a pin pointed answer. (small CCS change needed. Wich URL to site faster and more precise) pascal 1 Link to comment Share on other sites More sharing options...
SupraG Posted July 8, 2015 Share Posted July 8, 2015 Hi! I have hundreds of subcategories that could well use the same image.Example: CAT 1 Sub 1.1, 1.2, 1.3......I would like for PS to apply the same image to all subcategories under category 1 for example. Is that at all possible? Thank you very much! Link to comment Share on other sites More sharing options...
Fontaine77 Posted September 10, 2015 Share Posted September 10, 2015 Hi Pascal, Could you share the small CCS change you were mentioning before: "Hi NNG, do you have a link to your site, then we can give you a pin pointed answer. (small CCS change needed. Wich URL to site faster and more precise)" It would be of great help Thanks JR 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