Jump to content

Text formatting not working.


Recommended Posts

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 by wxanl (see edit history)
Link to comment
Share on other sites

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

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

52 minutes ago, 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

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

1 hour ago, 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

 

@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

9 minutes ago, 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.

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

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 by wxanl (see edit history)
Link to comment
Share on other sites

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...