wxanl Posted April 4, 2018 Share Posted April 4, 2018 (edited) I have a very strange problem. When i enter the short or long description of a product i can use text formatting inside the editor like bold or underlined etc. I can even see the result just fine while i am at it. But when i save the product and view it in the shop the formatting is not displayed. Just looks like it stripped all the HTML ? Any ideas ? Edited April 4, 2018 by wxanl (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted April 4, 2018 Share Posted April 4, 2018 Sounds like your template is stripping html out. Reach the theme folder via ftp, open product.tpl and look for $product->description_short and $product->description. See if they are escaped, and eventually remove the modifier Link to comment Share on other sites More sharing options...
wxanl Posted April 4, 2018 Author Share Posted April 4, 2018 Hi Nemo, thanx for the reply. I just checked that file and there is some html stripping but not for $product->description_short or $product->description as far as i can see. Is there maybe another location or file i could check ? Link to comment Share on other sites More sharing options...
NemoPS Posted April 6, 2018 Share Posted April 6, 2018 Hmm that's the only one. Prestashop version? You can try to add {debug}, a new window will pop up at page load, search for $product and see how those vars are looking over there Link to comment Share on other sites More sharing options...
wxanl Posted April 6, 2018 Author Share Posted April 6, 2018 On 4/6/2018 at 10:50 AM, NemoPS said: Hmm that's the only one. Prestashop version? You can try to add {debug}, a new window will pop up at page load, search for $product and see how those vars are looking over there Expand Thanx for your reply. Version is 1.6.1.11. I will set debug to on by changing from false to true define('_PS_MODE_DEV_', true); in config/defines.inc.php and test. Link to comment Share on other sites More sharing options...
selectshop.at Posted April 6, 2018 Share Posted April 6, 2018 On 4/6/2018 at 10:50 AM, NemoPS said: Hmm that's the only one. Prestashop version? You can try to add {debug}, a new window will pop up at page load, search for $product and see how those vars are looking over there Expand @wxanl I think that nemoPS is not talking about to set your site to mode debug, but to add {debug} to your product.tpl of your theme on first line. Open the file /themes/your theme/product.tpl and add as first line this {debug} Save the file to your FTP. Open the product-site of front-office and look for $product. Link to comment Share on other sites More sharing options...
wxanl Posted April 6, 2018 Author Share Posted April 6, 2018 On 4/6/2018 at 12:15 PM, selectshop.at said: @wxanl I think that nemoPS is not talking about to set your site to mode debug, but to add {debug} to your product.tpl of your theme on first line. Open the file /themes/your theme/product.tpl and add as first line this {debug} Save the file to your FTP. Open the product-site of front-office and look for $product. Expand Oh i see. I did not know about that. I will try that first. Thanx so much for explaining it to me. Link to comment Share on other sites More sharing options...
wxanl Posted April 6, 2018 Author Share Posted April 6, 2018 (edited) I am not sure where to look but the {debug} output of for example $product and $description_short is like this: ->description = "<p>Editor 1 <strong>TESTPRODUCT</stro..." ->description_short = "<p>Editor 1 <strong>TESTPRODUCT</stro..."Smarty_Variable Object (3)->value = "<p>Editor 1 <strong>TESTPRODUCT</stro..."->nocache = false So i suppose HTML tags are not stripped since i can see them in the code ? Edited April 6, 2018 by wxanl (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted April 9, 2018 Share Posted April 9, 2018 Correct, it must be happening at template level. Make sure strip tags and escape are removed, then clear cache (it might have been your previous issue) Fabio Link to comment Share on other sites More sharing options...
wxanl Posted April 9, 2018 Author Share Posted April 9, 2018 Thank you for the reply Fabio. That is what i thought to but it seems that i am unable to pinpoint the correct file or line to change. Even after i deleted all instances of |escape:'HTML' in /themes/name/product.tpl and cleaned the cache it still does not work. Not sure where to look next. Any advice ? Link to comment Share on other sites More sharing options...
selectshop.at Posted April 9, 2018 Share Posted April 9, 2018 Stupid question, but only for to get sure: After every change on file you are also deleting the smarty cache and browser cache ? Link to comment Share on other sites More sharing options...
wxanl Posted April 9, 2018 Author Share Posted April 9, 2018 There are no stupid questions, only stupid answers. I am not sure if i actually empty all the cache. After every change i press the "Clear Cache" button in the upper right hand side and reload the page using CTRL+F5. However, i i could not wrap my head around it so (out of frustration) i deleted all escape and strip tag entries again and edited the description of the product again. This time i used <strong> <underlined> <italic> and a font color. To my surprise everything seemed to work except <strong> So i checked the element and changed the font to arial and all of a sudden all HTML atributes are displayed. Not sure what is going on here but i suppose i will go and change the font in the css files manually. Thanx for all the advise and explanations ! Link to comment Share on other sites More sharing options...
selectshop.at Posted April 10, 2018 Share Posted April 10, 2018 I don't know your theme in use, but in general all themes have a global.tpl and a global.css. On this two files you will find the global settings of your theme. You should add to global.tpl the font-types in use and to global.css the functions like bold, center, etc.... After each change in files you need to delete smarty cache and your browser cache. Link to comment Share on other sites More sharing options...
wxanl Posted April 10, 2018 Author Share Posted April 10, 2018 (edited) Thank you for the additional info selectshop.at I will make the necessary changes in those files then. Also, i am not sure how mark this topic Solved ? Edited April 10, 2018 by wxanl (see edit history) 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