wysiwyg broken or txt area
6 posts by 2 authors in: Forums > CMS Builder
Last Post: July 24, 2013 (RSS)
By shawnpatoka - July 16, 2013
Hi,
In the record... in the WYSIWYG editor, when I click HTML and add a bunch of stuff, when i click "update" The code disappears, and doesnt save anything that i add.
I am only looking to add HTML code into this field, is there a way I can just avoid the WYSIWYG editor and just add a text box where I can enter in a chunk of code that will display on the website?
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
PHP Programmer - interactivetools.com
By shawnpatoka - July 17, 2013
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
PHP Programmer - interactivetools.com
By shawnpatoka - July 23, 2013
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
PHP Programmer - interactivetools.com