non-breaking space in product description

paulik

No avatar

2009-03-17 16:44

Hi, enybody knows how can I put   (non-breaking space) to the product description? Editor in Administration always replace   by normal space after save button is pressed.

» Quick.Cart v3.x

beholder

Avatar: beholder

2009-03-17 18:16

it depends on editor you're using. If you don't use the WYSIWYG editor, then you don't have this problem.

paulik

No avatar

2009-03-17 21:09

It doesn't work with turned off WYSIWYG too. What version of QC do you use? I'm using QC v3.1. Every time inserted   is unfortunately replaced with normal space.

beholder

Avatar: beholder

2009-03-17 23:54

let me explain.. when you first write   to your page (WYSIWYG is off), it gets written to the file correctly. But when you repeatedly save, the hard-space gets converted to another character (space).

Just for curiosity, perhaps after analysis in PHP it is possible that after repeated savings it is converted to a different character than "space". I've done some tests previously on saving a name of product and there the   gets converted to urldecode("%C2%A0"). This function returns the character that results from repeated saving of " " in product name in Quick.Cart.

paulik

No avatar

2009-03-18 00:25

There is realy   in the DB file after the record is first saved. But in pages you will see " ", because the "&" is replaced in HTML code with "&". I guessed that is a work of some function in libraries classes. Ugh. So, how can I put firmly together for example "-459.67 °F" and beware of separation at the end of page?

beholder

Avatar: beholder

2009-03-18 00:38

I just found an interesting reference for this:
http://bibliotek.dk/urlencode.php

beholder

Avatar: beholder

2009-03-18 00:53

paulik, it not as you write. When you're not using WYSIWYG, then after the 1st save the text of page "full description" gets fully rendered correctly into HTML with  

Please check one more time, I am sure of this. I work with 3.2.

paulik

No avatar

2009-03-18 00:58

Yes, you are right. The entity "&" I have got with WYSIWYG turned on. If it is turned off, it works. But till the second save.

beholder

Avatar: beholder

2009-03-18 01:17

so the solution is to create your page normally and when you're done and ready for the "final save", just rewrite all spaces with  
Then just don't touch the page anymore :-)

HOWEVER, this really IMO is a bug of Quick Cart, it should work normally at least in WYSIWYG mode off. Does NOT.

beholder

Avatar: beholder

2009-03-18 02:11

Now hold on to your seat, I just found out how to write hard spaces in tinyMCE (Quick Cart WYSIWYG editor)!!!!!!!!!!!!!

1. Edit the file templates/admin/edit.tpl, rewrite line:
entity_encoding : "raw",
to:
entity_encoding : "named",

2. Then under this line add following line:


entities 
"160,nbsp,38,amp,34,quot,162,cent,8364,euro,163,pound,165,yen,169,copy,174,reg,8482,trade,8240,permil,60,lt,62,gt,8 804,le,8805,ge,176,deg,8722,minus",



Now go edit your page using WYSIWYG editor!
Just remember to insert the non-breaking space using CTRL+SHIFT+SPACE keyboard shortcut or just use the html button, if you want to insert it directly by pressing the <html> button and writing the &nbsp; to the html code. Cheers!!

beholder

Avatar: beholder

2009-03-18 02:19

I am going to add some keywords for later searches:
HTML entities
Entity Encoding
TinyMCE entities
Encoding types raw named
hard space non-breaking space &nbsp;
tinyMCE init

paulik

No avatar

2009-03-18 13:39

Oh man, you are Master of Code! Thanks a lot. Many people will appreciate that.

Back to top
about us | contact