Jump to content

[Solved] Editable text style in short description in product list view


Recommended Posts

Hi,

 

I'm using the generic prestashop theme with V1.4.3

 

In the product list view the short description is limited to a single colour. In the product view the short description retains it's editing (style: colour, bold, upper/lower case etc.)

 

Is there a way to have the short description maintain it's format as it was entered in the editor?

 

Thanks.

Link to comment
Share on other sites

Hi,

 

I'm using the generic prestashop theme with V1.4.3

 

In the product list view the short description is limited to a single colour. In the product view the short description retains it's editing (style: colour, bold, upper/lower case etc.)

 

Is there a way to have the short description maintain it's format as it was entered in the editor?

 

Thanks.

 

Hi

 

Have you looked at the bottom left button down in editor , edit css? Maybe that is what you looking for?

 

Can you explain a little more.

 

indus

Link to comment
Share on other sites

Hi,

 

I'm using the generic prestashop theme with V1.4.3

 

In the product list view the short description is limited to a single colour. In the product view the short description retains it's editing (style: colour, bold, upper/lower case etc.)

 

Is there a way to have the short description maintain it's format as it was entered in the editor?

 

Thanks.

 

Hi

 

Have you looked at the bottom left button down in editor , edit css? Maybe that is what you looking for?

 

Can you explain a little more.

 

indus

 

Hi indus,

 

Thanks for the response and apologies for the late reply, Been away a few days.

 

To further explain when creating a new product in the catalogue the short description text can be easily formatted. However, when the product is viewed in the category view (product list) the short description formatting is overwritten and all the test is changed to a single colour.

 

I would like this Category view I would like the short description text to remain the same as it is in the product view.

 

Sorry if that's as clear as mud.

 

Any advice on this is appreciated.

 

Dave.

Link to comment
Share on other sites

Look for this line

				<p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'|escape:'htmlall':'UTF-8'}">{$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'}</a></p>

in your product-list.tpl file and remove the section that says

strip_tags:'UTF-8'|

remember to leave in one of the pipes to separate the truncate and escape codes. Should be about line 35

Link to comment
Share on other sites

Look for this line

				<p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'|escape:'htmlall':'UTF-8'}">{$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'}</a></p>

in your product-list.tpl file and remove the section that says

strip_tags:'UTF-8'|

remember to leave in one of the pipes to separate the truncate and escape codes. Should be about line 35

 

Hi jhnstcks,

 

Many thanks for this. I had to remove the second instance of

|strip_tags:'UTF-8'

to make it work and it was exactly what I was looking for, thank you.

 

One slight issue has arisen with this, when you cursor over the short description text it now shows the HTML with the text in the pop-up (not sure of the name of that box that appear on hover). Is there a way to eliminate this.

 

Very much appreciated.

Link to comment
Share on other sites

Try adding the first instance of strip_tags back in.

 

Thanks again.

 

Unfortunately it's still problematic. I also noticed that with this change some of the product list boxes have changed in size and on one product the Add to Cart and View are on top of each other.

 

In searching around I found a thread for the same thing which mentions 'If you remove strip_tags, page is no longer W3C compliant'. The code change was for V1.3 and is slightly different. http://www.prestashop.com/forums/topic/43107-solved-product-short-description-field-not-displaying-html/

 

Appreciate any further suggestions.

Link to comment
Share on other sites

Well, Here's the dreaded code. I would just like to know how to stop the html formatting being stripped out in the product list short descriptions

 

I have tried the suggestions that jhnstcks kindly offered but unfortunately it hasn't been successful as it affects the layout of the boxes.

 

				<p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'|escape:'htmlall':'UTF-8'}">{$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'}</a></p>
		</div>

 

Any suggestions very welcome.

Link to comment
Share on other sites

Finally got this sorted and jhnstcks's suggestion was spot on after all.

 

Initially, after removing the second instance of |strip_tags:'UTF-8' from the code some of the product list boxes screwed up on the formatting.

 

However, this only happened to existing products, new products were perfectly fine and the text formatting was carried over from the products short description the the product list boxes.

 

For the product list boxes that were screwed up, I simply created a new product for them and then they were fine too.

 

Big thanks to jhnstcks.

Link to comment
Share on other sites

  • 3 years later...

Hi,

 

Resurrecting an old post here as the issue is the same, the version now is 1.6.0.9.

 

Trying to keep the text formatting in the short description in product list. I think the change should still be done in the product-list.tpl file. I only see one instance of   |strip_tags:'UTF-8' and when I remove this it also limits the amount of text (truncates ?).

 

Appreciate any advice.

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

×
×
  • Create New...