wysiwyg broken or txt area

6 posts by 2 authors in: Forums > CMS Builder
Last Post: July 24, 2013   (RSS)

By gregThomas - July 17, 2013

Hi,

You could add a text area instead for the user to add their HTML too. To change your WYSIWYG to a text area login into CMSB, then go to the section editors area. Click the modify link for the section in the list you want to change. On the next page you should see a list of the fields that are in the section, if you click modify on the WYSIWYG field, it will bring up a dialog box allowing you to change options for the field.

You should see a drop down list called Field Type, you need to select the text box from it. Then save your changes.

Let me know if you have any questions.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

when i had it as a text area, it would show all of the HTML code on the website

By gregThomas - July 18, 2013

Could you paste the code you are using to display the field on your page? Are you using the htmlspecialchars function or the htmlencode encode function on the field? As these will cause the HTML characters to be displayed as opposed to being processed.

Thanks

Greg

Greg Thomas







PHP Programmer - interactivetools.com

sorry for the delayed response...

<?php echo htmlencode($record['streamaddress']) ?>

that is what I am currently using and it is displaying the full HTML instead of actually rendering the HTML. I also tried...

<?php echo htmlspecialchars($record['streamaddress']) ?>

By gregThomas - July 24, 2013

Hi  shawnpatoka,

The issue is your using htmlencode/htmlspecialchars when you display the variable, and these functions convert special charters into there html entities, you can read more about the function here: http://php.net/manual/en/function.htmlspecialchars.php

To fix the issue you just need to remove the htmlencode/htmlspecialchars function:

<?php echo $record['streamaddress']; ?>

Cheers!

Greg

Greg Thomas







PHP Programmer - interactivetools.com