Guest Posted January 8, 2015 Share Posted January 8, 2015 Hi I need to change the truncate level on the subcategory list to show full category titles I found this code in category.tpl <h5><a class="subcategory-name" href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}">{$subcategory.name|truncate:80 :'...'|escape:'html':'UTF-8'|truncate:350}</a></h5> The default: $subcategory.name|truncate:25 I have changed to 80 and that works great But of course if o update prestashop version (currently 1.6.0.9) then it could be over ridden. I have a css overide module. Can this truncate be altered via CSS? Link to comment Share on other sites More sharing options...
Dh42 Posted January 8, 2015 Share Posted January 8, 2015 Not in a good way to be honest. You should name your theme so it is not the default theme and you will not have any issues with upgrades. Link to comment Share on other sites More sharing options...
Promokit Posted January 8, 2015 Share Posted January 8, 2015 Hello Haylau. Yes, it's possible to do with css. Try this: .truncate { width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } Link to comment Share on other sites More sharing options...
Guest Posted January 8, 2015 Share Posted January 8, 2015 Not in a good way to be honest. You should name your theme so it is not the default theme and you will not have any issues with upgrades. Yes, but the problem then is that the theme will not benefit from any future "good" upgrades pushed from Prestashop. But then again, I quite like how we have the theme now, so i suppose it may be best Hello Haylau. Yes, it's possible to do with css. Try this: .truncate { width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } Will that change every "truncate" on the whole site theme to be the same. I need it to be just this one occurrence. I will try it and see Link to comment Share on other sites More sharing options...
Promokit Posted January 8, 2015 Share Posted January 8, 2015 You can use class "truncate" for any element you want. Link to comment Share on other sites More sharing options...
Dh42 Posted January 8, 2015 Share Posted January 8, 2015 If you are just trying to target one category you can add {$category->name} to the body tag id and use #cars.trucate {css here} to target that one page. Link to comment Share on other sites More sharing options...
Guest Posted January 8, 2015 Share Posted January 8, 2015 If you are just trying to target one category you can add {$category->name} to the body tag id and use #cars.trucate {css here} to target that one page. No, not a specific category Basically it this : Our category and subcategory names tend to be quite long because of the complexity of what we sell - and we have a lot of subcategories When we click on a category all the subcategories are displayed, it is that list of sub categories I a need to truncate So as you can see in the screen print, I have adjusted them using truncate in the tpl file. Just need the code to do the same in CSS, but I think I will go with the copying of the theme Link to comment Share on other sites More sharing options...
Dh42 Posted January 8, 2015 Share Posted January 8, 2015 It will never work like I pointed out before. See this is the issue, with the css fix you need to add the truncate class to the category.tpl but an update will erase it. Or you can add the css to truncate to the category.css file. But at the same time an update will erase that as well. Link to comment Share on other sites More sharing options...
Guest Posted January 8, 2015 Share Posted January 8, 2015 No problem, will stick to your original suggestion of copying the theme. Thanks for your help Link to comment Share on other sites More sharing options...
Recommended Posts