Maxima Posted September 22, 2015 Share Posted September 22, 2015 Can I Enable HTML for the short description on Product-listing Page (Category Page). i have use some bullets, line-breaks and hyper-link in "short description" though it is all fine on Product Page but it seems a mess on product-listing Page's List View. Why html is stripped off on product listing page (short description)? And if in some way i enable it, would that be a Risk by any means? Link to comment Share on other sites More sharing options...
NemoPS Posted September 23, 2015 Share Posted September 23, 2015 No risk. Just get rid of strip_tags here {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'} in product-list.tpl 1 Link to comment Share on other sites More sharing options...
Maxima Posted September 27, 2015 Author Share Posted September 27, 2015 (edited) One more thing in short description, I have added a link (size chart image) to display in a fancy box. I have tried as you've said {$product.description_short|truncate:360:'...'} And also this {$product.description_short|truncate:360:'...'|escape:'html':'UTF-8'} But Didnt get the desired result Any suggestions.. Edited September 27, 2015 by Maxima (see edit history) Link to comment Share on other sites More sharing options...
gabdara Posted September 27, 2015 Share Posted September 27, 2015 Instead of the p tag that is wrapping the short description use div tag. <div class="product-desc" itemprop="description"> {$product.description_short} </div> 1 Link to comment Share on other sites More sharing options...
Maxima Posted September 27, 2015 Author Share Posted September 27, 2015 I have tried this too, but going through all the options either I get no description with messed up layout Or All the script and tags appear instead of proper formatted short description as is on product page. Link to comment Share on other sites More sharing options...
gabdara Posted September 28, 2015 Share Posted September 28, 2015 If you don't apply any modifiers (like escape, truncate, strip_tags) and use div it should work. I've tried it on a default PrestaShop v1.6.1.1 . Link to comment Share on other sites More sharing options...
Maxima Posted September 28, 2015 Author Share Posted September 28, 2015 Thanks gabdara, I've tried again and it worked, maybe have missed something previously... Link to comment Share on other sites More sharing options...
Daresh Posted February 1, 2016 Share Posted February 1, 2016 For the record - you also need to replace the "p" class="product-desc" with "div" in your global.js, without it switching between grid and list won't work. Link to comment Share on other sites More sharing options...
motion2082 Posted April 6, 2016 Share Posted April 6, 2016 (edited) For the record - you also need to replace the "p" class="product-desc" with "div" in your global.js, without it switching between grid and list won't work. I tried this and still had issues however I'm amending the /theme/js/global.js file I'm wondering if I'm better off editing another file? Thoughts on this? Edited April 7, 2016 by motion2082 (see edit history) Link to comment Share on other sites More sharing options...
JUICYDESIGN Posted August 22, 2016 Share Posted August 22, 2016 My solution for HTML in Shortdescription without truncate > <div class="">{($product->description_short)}</div> in product.tpl You can create own class for div content format or special format only in this content div. Link to comment Share on other sites More sharing options...
Recommended Posts