robbie007 Posted January 8, 2015 Share Posted January 8, 2015 (edited) When increasing the truncate of product-list.tpl titles display on 1 or 2 rows/lines. Short ones on 1 row and longer ones on 2 rows. It's doesn't look great on the screen because there are differences in height. So you can increase truncate, but why not increasing titles default to 2 rows as well??? Edited January 12, 2015 by robbie007 (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted January 9, 2015 Share Posted January 9, 2015 robbie, can you give a link to your site? You can normally change things with css to give the product boxes a fixed height, but easiest to help when seeing the site. What PS version do you use? pascal. Link to comment Share on other sites More sharing options...
vekia Posted January 9, 2015 Share Posted January 9, 2015 So you can increase truncate, but why not increasing titles default to 2 rows as well??? truncating is not based on rows but on number of chars, some chars are wider that others, for example "W" is much wider than "i". this is why it generating problems related to "width" of the title. you have to use monospaced font... Link to comment Share on other sites More sharing options...
robbie007 Posted January 12, 2015 Author Share Posted January 12, 2015 Thanks for the replies guys! As PascalVG mentioned you can solve it the easy way with CSS and tweek a bit with the truncate. Will mark this one as solved Link to comment Share on other sites More sharing options...
henryyao Posted January 26, 2015 Share Posted January 26, 2015 (edited) how can I use truncate with unicode characters? I set truncate to 20, but it doesn't seem the same across these names.... Edited January 26, 2015 by henryyao (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted January 26, 2015 Share Posted January 26, 2015 can you show what is the difference? i don't understand the problem you have well Link to comment Share on other sites More sharing options...
henryyao Posted January 26, 2015 Share Posted January 26, 2015 Hi Vekia, Here is a link to my website (sorry for the chinese), but I think it should be clear enough to show my issue: some of the products show the name a lot longer than the others. I set the truncate all to 20 and I expect them to show the same number of unicode characters before "...". http://www.yaoay.com/zh/31-%E6%8A%A4%E8%82%A4%E4%BF%9D%E5%85%BB?p=2 Link to comment Share on other sites More sharing options...
henryyao Posted January 26, 2015 Share Posted January 26, 2015 Also, on a related topic, as you can see there are so many results with "mediheal" in the title, but when I search for "mediheal", only 6 results show. Do you have any clue how to fix that? Link to comment Share on other sites More sharing options...
PascalVG Posted January 29, 2015 Share Posted January 29, 2015 Henry, Truncate by default tries to truncate by whole word. So if you have for example a var $productName with some long words, like: (Truncate at 15: {$productName|truncate:15:"..."} ) "Green automobile", it will show only "Green..." as when including the word automobile, it would be too long (16 characters)) If you want to truncate by exactly the amount of characters, you can add a third parameter, like: {$productName|truncate:15:"...":true} In above sample, this would result in "Green automobil..." For more info, see here Hope this helps, pascal. Link to comment Share on other sites More sharing options...
PascalVG Posted January 29, 2015 Share Posted January 29, 2015 Henry, About the search: Prestashop indexes words or product names (and description etc). When searching, it looks for words that start with the search string: say Product name: "Green Automobile" PS indexes the words: 1) Green 2) Automobile When searching for : "Aut" this product will be found but when searching for "mobi" This product won't be found, as no indexed word starts with mobi To solve it, maybe you can add a space character before the English words, so that they will be indexed separately, instead of together with the Chinese characters before them. if that won't work, there is some workaround here:https://www.prestashop.com/forums/topic/280306-native-prestashop-search-module-issuessolved-casesimprovementsother/?do=findComment&comment=1434584 But be careful, as the solution might slow down search considerably with databases with many products/long descriptions etc. (Read the whole thread to get an idea of the problems encountered then) Hope this helps, pascal 1 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