Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

wysiwyg editor Rate Topic   - - - - -

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10912 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: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 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.
Hire StellarBytes for CS-Cart Design & Development Services

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10912 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: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • StellarBytes
  • Senior Member
  • Members
  • Join Date: 08-Aug 11
  • 1807 posts

Posted 07 February 2013 - 10:52 AM #4

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!
Hire StellarBytes for CS-Cart Design & Development Services

 
  • nagamahesh22
  • Advanced Member
  • Trial users
  • Join Date: 26-Mar 16
  • 50 posts

Posted 02 July 2016 - 07:39 AM #5

HI,

 

I am using cm-wysiwyg to create html editor. my problem is getting value in field to display html content but not displaying front end content in field. Please slove this issue.

 

code:-

 

<div class="control-group">
   <label class="control-label" for="content">{__("content")}:</label>
   <div class="controls">
      <textarea type="text" name="content" id="content" value="" cols="55" rows="5" class="span8 cm-wysiwyg"> </textarea>
 
   </div>
</div>
 
Regards
mahesh,
maheshbondada@gmail.com.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 04 July 2016 - 08:15 AM #6

HI,
 
I am using cm-wysiwyg to create html editor. my problem is getting value in field to display html content but not displaying front end content in field. Please slove this issue.
 
code:-
 
<div class="control-group">
   <label class="control-label" for="content">{__("content")}:</label>
   <div class="controls">
      <textarea type="text" name="content" id="content" value="" cols="55" rows="5" class="span8 cm-wysiwyg"> </textarea>
 
   </div>
</div>
 
Regards
mahesh,
maheshbondada@gmail.com.

 

Is it saved to the database correctly? If yes, you should get value from the database and display it in the following manner:

<textarea type="text" name="content" id="content" value="" cols="55" rows="5" class="span8 cm-wysiwyg">{$variable_with_content}</textarea>

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • nagamahesh22
  • Advanced Member
  • Trial users
  • Join Date: 26-Mar 16
  • 50 posts

Posted 05 July 2016 - 05:19 AM #7

 

Is it saved to the database correctly? If yes, you should get value from the database and display it in the following manner:

<textarea type="text" name="content" id="content" value="" cols="55" rows="5" class="span8 cm-wysiwyg">{$variable_with_content}</textarea>

 

This code is not working. my problem is same. I have assigned input  value is "hello". The data is stored these type "<p>hello</p>" in database.But, Getting value also same html type.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 05 July 2016 - 06:42 AM #8

How do you get saved value from the database?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • nagamahesh22
  • Advanced Member
  • Trial users
  • Join Date: 26-Mar 16
  • 50 posts

Posted 05 July 2016 - 07:09 AM #9

How do you get saved value from the database?

 

After saving value from the databaseThe getting database values in table on the same page and selected row getting values in same form using msg_id through javascript.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 05 July 2016 - 07:20 AM #10

I am afraid, we are not able to help you without code review


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • nagamahesh22
  • Advanced Member
  • Trial users
  • Join Date: 26-Mar 16
  • 50 posts

Posted 05 July 2016 - 09:09 AM #11

I am afraid, we are not able to help you without code review

{include file="views/profiles/components/profiles_scripts.tpl"}

{assign var="users_names" value=fn_get_users_names()}
{assign var="messagelist" value=fn_get_push_messagelist()}
{assign var="retrieve" value=fn_get_push_retrieve()}

<link rel="stylesheet" type="text/css" href="design/backend/css/push_notification.css" />
<link rel="stylesheet" type="text/css" href="design/backend/css/dataTables.bootstrap.min.css" />
<script src="js/tygh/jquery.dataTables.min.js"></script>

{capture name="mainbox"}

<!-- select compose or individual dropdown-->

<form action="{""|fn_url}" width="100%" class="form-horizontal" method="post" name="compose_push_notification" id="compose_push_notification">
<div class="control-group">
   <label for="compose_list" class="control-label">{include file="common/subheader.tpl" title=_("Select an option")}</label>
   <div class="controls">
      <select name="compose_list" class="span6" style="height: 40px;margin-top: 20px;">
         <option value="select" selected="selected"> Select option </option>
         <option value = "1" >Group</option>
         <option value = "2" >Individual</option>
      </select>
   </div>
</div>
</form>
<div>
<form action="{""|fn_url}" class="form-horizontal" name="compose_group" id="compose_group" method="post" style="display:none" >
{include file="common/subheader.tpl" title=_("Enter Your Notification Message")}
<input type="hidden" name="msg_id" id="msg_id" />
  {if $users_names}
   
                  {foreach from=$users_names item="names"}  
                
          <input type="hidden" name="individual[{$names.user_id}]" id="individual[{$names.user_id}]" value="{$names.email}" onChange="javascript: getMailID(this)" /> 
              
                  {/foreach}
 
{/if}
<div class="control-group">
   <label for="title" class="control-label cm-required">{_("Title")}:</label>
   <div class="controls">
      <input type="text" id="title" name="title" size="32" class="span6" value="{$title}" />
   </div>
</div>

<!--<div class="control-group">
   <label class="control-label cm-required" for="message">{__("Message")}:</label>
   <div class="controls">
      <textarea type="text" name="message" id="message" value="{$message}" cols="55" rows="5" class="span6 message"></textarea>
   </div>
</div>-->
<div class="control-group">
   <label class="control-label" for="content">{__("content")}:</label>
   <div class="controls">   
      
  <textarea type="text" name="messages[content]" id="content" value="" cols="55" rows="5" class="span8 cm-wysiwyg"> {$content} </textarea>

   </div>
</div>
<div class="control-group">
   <input class="btn btn-primary" style="padding-bottom: 27px;padding-top: 10px;margin-left:20%;" type="submit" name="dispatch[profiles.group]" value="send"/>
</div>

</form>


<form action="{""|fn_url}" class="form-horizontal" name="compose_individual" id="compose_individual" method="post" style="display:none">

{include file="common/subheader.tpl" title=_("Select the User's List")} 

<input type="hidden" name="msg_id" id="msg_id1" />

{if $users_names}
<div class="control-group">
 <label for="individual" class="control-label">{_("Emails")}:</label>
     <div class="controls"> 
         <div>
           	<div id="navcontainer"> 
			 <!--<span class="hida" id="hida" style="border:none;display:none;"><b>Select Options</b></span><span style="border:none;float:right;">&#9660;</span>-->  
				   <ul name="uList" id="uList"></ul>
            </div>
            <div class="boxEffect" id="boxEffect">
               <ul>
                  {foreach from=$users_names item="names"}  
                  <li>
          <input type="checkbox" name="individual[{$names.user_id}]" id="individual[{$names.user_id}]" value="{$names.email}" onChange="javascript: getMailID(this)" /> {$names.email}
                  </li>
                  {/foreach}
               </ul>
           </div>
		  </div>
	</div>
</div>
 
{/if}

<div class="control-group">
   <label for="title" class="control-label">{_("Title")}:</label>
   <div class="controls">
      <input type="text" id="title1" name="title" size="32" class="span6" value="{$title}" />
   </div>
</div>

<!--<div class="control-group">
   <label  for="message" class="control-label">{__("Message")}:</label>
   <div class="controls">
      <textarea type="text" name="message" id="message" value="$message" cols="55" rows="5" class="span6 message"></textarea>
   </div>
</div>
-->
<div class="control-group">
   <label class="control-label" for="content">{__("Content")}:</label>
   <div class="controls">
      <textarea type="text" name="content" id="content1" value="" cols="55" rows="5" class="span6 cm-wysiwyg"></textarea>
	  
   </div>
</div>

<div class="control-group">
   <input class="btn btn-primary" style="padding-bottom: 27px;padding-top: 10px;margin-left:20%;" type="submit" name="dispatch[profiles.compose1]" value="send"/>
</div>
{literal}
<script type="text/javascript">

	function getMailID(status)
	{
		var checkBoxStatus= status.checked;
		var checkBoxId= $(status).attr('id');
		var checkBoxClass= $(status).attr('class');
		var checkBoxValue = $(status).val();
	
		if(checkBoxStatus == true)
		{ 
		    var uList = document.getElementById('uList');
		    var listItem = document.createElement('li');
			
		    listItem.appendChild(document.createTextNode(checkBoxValue));
		    listItem.id = checkBoxValue;
			
		    var anchor = document.createElement("img");
		    anchor.src = "images/push_close.png";
			
		    listItem.appendChild(anchor);
			 
		    anchor.onclick = function() 
		    { 
		       document.getElementById(checkBoxId).checked = false;
		       $(listItem).remove();
		    };
			
		    uList.appendChild(listItem);
		}
		
		else
		{
			document.getElementById(checkBoxValue).remove();
			document.getElementById(hida).show();
		}	
	}

</script>

{/literal}

</form>

<form action="{""|fn_url}" method="post" name="resend_data" id="resend_data">

<div class="message_list" style="display:none;" id="message_list">

{include file="common/subheader.tpl" title=_("Previous Sended Data")}

<table class="table table-middle" id="example" class="example" style="width:100%">

<thead>
	<tr><th></th><th>Msg_Id</th><th>Title</th><th>Content</th></tr>
</thead>	  

	{foreach from=$messagelist item="messages"}

	<tr onClick="javascript:showRow(this);">
	<td><input type="radio" name="post_data[$messages.msg_id]" id="post_data{$messages.msg_id}" value="{$messages.msg_id}" onClick="javascript:showRow(this);"/></td>        	    <td>{$messages.msg_id}</td>
	<td>{$messages.Title}</td>
	<td>{$messages.content}</td>
	</tr>
	
	{/foreach}
	
</table>
</div>
</form>

{/capture}



<script language="javascript" type="text/javascript">

function showRow(row)
{
var x = row.cells;

document.getElementById("msg_id").value = document.getElementById("msg_id1").value= x[1].innerHTML;

document.getElementById("title").value = document.getElementById("title1").value = x[2].innerHTML;

document.getElementById("content").value = document.getElementById("content1").value = x[3].innerHTML;

}

</script>

<script>

   $('form select[name=compose_list]').change(function(){
     if ($('form select option:selected').val() == '1'){
       $('#compose_group').show();
	    $('#message_list').show();
     }else{
       $('#compose_group').hide();
     }
     if ($('form select option:selected').val() == '2'){
       $('#compose_individual').show();
	    $('#message_list').show();
     }else{
       $('#compose_individual').hide();
     }
   });
   
</script>

<script>
$(document).ready(function(){
    $("#navcontainer").click(function(){
        $("#boxEffect").toggle();
    });
});
</script>

<script>
$(document).ready(function() {
    $('#example').DataTable();
} );
</script>

{include file="common/mainbox.tpl" title='Compose' content=$smarty.capture.mainbox}


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 05 July 2016 - 02:14 PM #12

So the textarea is empty or it contains text without html tags?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • nagamahesh22
  • Advanced Member
  • Trial users
  • Join Date: 26-Mar 16
  • 50 posts

Posted 06 July 2016 - 05:05 AM #13

So the textarea is empty or it contains text without html tags?

textarea is empty after clicking html tag button to display html format.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 06 July 2016 - 06:55 AM #14

So the entered text is displayed correctly after the page is reloaded. But if you switch WYSIWYG editor to the HTML mode, you see empty text area. Am I right?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • nagamahesh22
  • Advanced Member
  • Trial users
  • Join Date: 26-Mar 16
  • 50 posts

Posted 06 July 2016 - 07:03 AM #15

So the entered text is displayed correctly after the page is reloaded. But if you switch WYSIWYG editor to the HTML mode, you see empty text area. Am I right?

 

Yaa! its right. How to fix it



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 06 July 2016 - 07:09 AM #16

It is required to examine issue on your server. We constantly use WYSIWYG editors in our projects and have never faced such issue


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10912 posts

Posted 06 July 2016 - 07:46 PM #17

But do note that wssiwyg editor support was only added to the customer side of things in (I think) V4.3.5 (could have been a release or two earlier but it used to be restricted to the admin area only without changing the core js code.)


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • nagamahesh22
  • Advanced Member
  • Trial users
  • Join Date: 26-Mar 16
  • 50 posts

Posted 26 July 2016 - 09:38 AM #18

Hi,

 

I have a problem sending email function. All values are getting correctly, but email content is displayed to html tags in the mails. How to display without html tags to sending content in mails.

 

Regards,

 

naga mahesh bondada,

maheshbondada2@gmail.com.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10912 posts

Posted 26 July 2016 - 06:51 PM #19

Are you sending your own templates?  If so, use the 'nofilter' attribute of your smarty tags.  I.e.

{$my_body nofilter}

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • nagamahesh22
  • Advanced Member
  • Trial users
  • Join Date: 26-Mar 16
  • 50 posts

Posted 27 July 2016 - 05:48 PM #20

 

Are you sending your own templates?  If so, use the 'nofilter' attribute of your smarty tags.  I.e

{$my_body nofilter}

 

yes,i am sending my own templates. your idea is worked. Thank u so much for helping me.