Jump to content

wysiwyg editor Rate Topic   - - - - -

 
  • tbirnseth
  • Senior Member
  • Members
  • Join Date: 08-Nov 08
  • 5,239 posts

Posted 16 March 2012 - 06:33 PM #1

Well, there has to be a siimple answer. One of my clients wanted the wysiwyg editor on a textarea in their admin. It was eays to add cm-wsiwyg to the class and viola, the editor appeared.

However, when i put two lines like
Test line 1

Test line 2

The HTML shows as two paragraphs (what is expected) but when the data is POSTED it comes into the controller as 2 newline separated lines versus the two html paragraphs.

So what's the trick to getting it to POST html code so that the editor is useful? I must be missing something.

The textara tag looks like:
<textarea id="big_commentr" name="big_comment" cols="55" rows="8" class="cm-wysiwyg input-textarea-long">
  {$big_comment}
</textarea>

But when $_REQUEST['big_comment'] is received in the controller the string is "Test line 1\nTest line 2" where it should be "<p>Test line 1</p><p>Test line 2</p>".
EZ Merchant Solutions

Authorized Reseller - Cart licenses: $305 (lowest reseller price)
Custom B2B Development, Consulting and Special Projects (get a quote).
Commercial addons to meet your business and operations needs.

http://www.ez-ms.com

 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1,274 posts

Posted 06 February 2013 - 12:56 PM #2

Did you ever figure this one out Tony? Just been reviewing the code structure for SEO purposes on a 2.2.4 site and noticed all content entered using the WYSIWYG editor is coming out like so:
<p>
	    <p>This if the first paragraph and tells a little story.</p>
	    <p>This is the second paragraph.</p>
</p>
Disable WYSIWYG editor and that becomes:
	    <p>This if the first paragraph and tells a little story.</p>
	    <p>This is the second paragraph.</p>
So now stuck with <p> tags within <p> tags if I want to use the WYSIWYG editor. Wouldn't mind so much if it was <span> tags but not the same declaration tags within itself.

 
  • tbirnseth
  • Senior Member
  • Members
  • Join Date: 08-Nov 08
  • 5,239 posts

Posted 07 February 2013 - 03:52 AM #3

Looks like somenone cut/pasted html when editior was active.
Take it out, edit it and then paste it back in without any formatting.
EZ Merchant Solutions

Authorized Reseller - Cart licenses: $305 (lowest reseller price)
Custom B2B Development, Consulting and Special Projects (get a quote).
Commercial addons to meet your business and operations needs.

http://www.ez-ms.com

 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1,274 posts

Posted 07 February 2013 - 10:52 AM #4

View Posttbirnseth, on 07 February 2013 - 03:52 AM, said:

Looks like somenone cut/pasted html when editior was active.
Take it out, edit it and then paste it back in without any formatting.
That's what I thought, so that's what I tried and succeeded using Firefox.

Incidentally I've discovered this only seems to happen when Internet Explorer 9 is used, although I would have thought the parsing has nothing to do with the browser, perhaps not though.

Now if only some of computer illiterate ones can be trained to point and click using another browser...might just be easier to find and force a fix in CS-Cart!