Salus Posted June 4, 2014 Share Posted June 4, 2014 (edited) Hi, friends, I am in need of your help again. I modified default theme a bit, taken out the short description from product list to get more clean look and more space. But short description is still necessary, so I wanted to change the mouse hover action from showing the image legend o show image short description. Modified product_list.tpl accordingly, like this: <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'}" alt="{if !empty($product.name)}{$product.name|escape:'htmlall':'UTF-8'}{else}{$product.name|escape:'htmlall':'UTF-8'}{/if}" title="{if !empty($product.description_short)}{$product.description_short|escape:'htmlall':'UTF-8'}{else}{$product.name|escape:'htmlall':'UTF-8'}{/if}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} /> basically replaced legend with short description. It works, but I have the descr_short paragraph tag inside the description, as shows in the attached image. Please tell me how to get rid if of this <p> tag? Oh, and how can I edit that pop-up text bubble (background, font size, margins, etc)? Thank you in advance, Cheers Salus PS: I am almost done with our site, and I must say that although it was a quite long process, I learned a LOT from you guys. Started as a total noob (i mean I never laid eyes on a html or smarty code before), and now I may say that I know the very basics, wich is a LOT for me. And all this THANKS TO YOU , GUYS, and I really appreciate all your support and patience, and you all are a bunch of great good people Specially vekia... yes. Edited June 6, 2014 by Salus (see edit history) Link to comment Share on other sites More sharing options...
dioniz Posted June 4, 2014 Share Posted June 4, 2014 That <p> tag is probably added by html editor but i have no idea how to remove it because on save it come back. Maybe this post will help you: http://www.prestashop.com/forums/topic/269378-solved-extra-p-tags-when-removing-strip-tags-in-short-description/ pop up bubble is system bubble so i don't think you can change that. Link to comment Share on other sites More sharing options...
S-HAMMANI Posted June 5, 2014 Share Posted June 5, 2014 Hi you can try to replace this code: ( {$product.name|escape:'htmlall':'UTF-8'}..... 'htmlall' .............. with this one: ....{$product.name|escape:'html':'UTF-8'}.....'html' ............... Link to comment Share on other sites More sharing options...
Salus Posted June 5, 2014 Author Share Posted June 5, 2014 Thanks a lot for replies. S-Hammani, your solution would have been ideal, if it would work... but unfortunately it doesn`t. Dioniz, i think you have a point, I'm struggling to comprehend that TinyMCE thing from the link you shared, I`ll be back with a result Link to comment Share on other sites More sharing options...
PSfever.com Posted June 5, 2014 Share Posted June 5, 2014 How about {if !empty($product.description_short)}{$product.description_short|strip_tags|escape:'htmlall':'UTF-8'}{else}{$product.name|escape:'htmlall':'UTF-8'}{/if} It should strip HTML tags More here: http://www.smarty.net/docsv2/en/language.modifier.strip.tags.tpl Link to comment Share on other sites More sharing options...
Salus Posted June 5, 2014 Author Share Posted June 5, 2014 Ok, i think I have to share this. I have choosen this solution: http://www.prestashop.com/forums/topic/43107-solved-product-short-description-field-not-displaying-html/?do=findComment&comment=301288 SO my line looks like this: <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'}" alt="{if !empty($product.name)}{$product.name|escape:'htmlall':'UTF-8'}{else}{$product.name|escape:'htmlall':'UTF-8'}{/if}" title="{if !empty($product.description_short)}{$product.description_short|substr:0:3 == '<p>'}{$product.description_short|substr:3:-4|truncate:360:'...'}{else}{$product.name|escape:'htmlall':'UTF-8'}{/if}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} /> We are almost there, but there must be a logical error of some kind, because - although it works to some extent, it did take out the <p> tags from beginning and from the end of description, - it leaves a number 1 at beginning of every line, and in some cases I get weird code inside the description. let me show you: The ones that are messed up are few, and the hover info is like this: what say you, how can this be fixed? Link to comment Share on other sites More sharing options...
S-HAMMANI Posted June 5, 2014 Share Posted June 5, 2014 Hi again for this ? <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{if !empty($product.name)} {$product.name|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" title="{if !empty($product.description_short)}{$product.description_short|strip_tags:false} {$product.description_short|strip_tags:false|truncate:360:'...'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} /> Link to comment Share on other sites More sharing options...
Salus Posted June 6, 2014 Author Share Posted June 6, 2014 Hi again for this ? <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{if !empty($product.name)} {$product.name|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" title="{if !empty($product.description_short)}{$product.description_short|strip_tags:false} {$product.description_short|strip_tags:false|truncate:360:'...'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} /> Sorry for late answer. Yes, S-Hammani, it works perfectly. Is seems that this /strip-tags is the key. I only had to cut this part out: {$product.description_short|strip_tags:false|truncate:360:'...'} because with the above, it shows the short description 2 times. I can survive without the truncate thing, i am keeping the pruduct names under 360 chars. Thank you all for your help, guys, I learned something useful again today. S-hammani, dioniz, PSfever, you`ve done me a great service, i really appreciate your help and invested time, thank you. 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