Jump to content

Insert HTML code in product description


Recommended Posts

  • 5 months later...

I'm interested in this post as well.

 

I have been trying to format the Description filed in Products for sometime now and it seems to ignore formatting when displayed on the Front Office.

 

Bold, underline etc works but I just want to simply insert either single or multiple blank lines between each sentence or paragraph but is just "wraps" all of text.

Link to comment
Share on other sites

for example, in the list

					<p class="product-desc" itemprop="description">
						{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}
					</p>

to

					<div class="product-desc" itemprop="description">
						{$product.description_short|truncate:360:'...'}
					</div>
Link to comment
Share on other sites

{$product.description_short|truncate:360:'...'}

it's worth to mention that with truncate and without strip_tags some html tags from begining parts of product.description variable will not be closed. These unclosed tags can generate some theme problems.

Link to comment
Share on other sites

lateral, Prestashop and other open source projects make use of other "open source" projects. For example both PS and Word Press use PHP and MySQL. Additionally PS makes use of Smarty, jQuery and TinyMCE. 
 
TinyMCE is the editor you use when entering descriptions. 
 
My point here is the PS uses a chain of open source projects. So to solve some problems it helps to learn work around's to the individual software projects that add to your powerfull PS shop.
 
If you have used the method posted above to remove the html striping tag, and you find that the WYSIWYG editor provided by TinyMCE is causing you problems, then make use of the HTML feature provided by TinyMCE, and use a couple of old fashion html tags.
 
The <br> tag inserts a single line break.
Two <br> tags inserts a double line break.
 
Just click on the HTML button on your TinyMCE editor to insert any HTML directly. 
 

Easypeasy.   :)

Edited by Bill Dalton (see edit history)
Link to comment
Share on other sites

Hello,

 

I am also trying to add multiple line breaks in the Description field. But its stripping it, or not applying it.

 

Looking through the code, I can only see strip_tags applied to the 'short_description' fields though.

Link to comment
Share on other sites

Hi Dan

 

This is what I needed to do to get the formatting that I wanted:

 

<p>Mounting tabs - Steel tabs for various applications , many different styles.<br /><br /></p>
<p>Price is "from" price.</p>

 

This gives me the spacing I required.

Link to comment
Share on other sites

  • 1 year later...

Hi Guys, sorry that I'm talking about between them ;-) But we have sameless problem.... we format entrys from product - shortdescription especially bold, breaks etc but doesnt work. All formatted text in frointend shows in one line without format... how can we solve this? Thanks for help

 

We use PS Version 1.6.1.4

Edited by JUICYDESIGN (see edit history)
Link to comment
Share on other sites

Hi Guys, sorry that I'm talking about between them ;-) But we have sameless problem.... we format entrys from product - shortdescription especially bold, breaks etc but doesnt work. All formatted text in frointend shows in one line without format... how can we solve this? Thanks for help

 

We use PS Version 1.6.1.4

Are you talking about imported products ? You can use HTML-editor on your back-officve on product description. There is an icon for HTML-code. For import it is true you cannot manage HTML. Better is import raw text and than format it manually.

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...