views:

487

answers:

4

I'm in the process of building a content management system for a scientific journal. The system is designed with content "blocks" that editors can manipulate using the FCKEditor. I am trying to display these "blocks" read-only in the system without the editor. My concern is "rogue" HTML that could break the rest of the page if the HTML isn't valid. I was thinking of using an iframe to segregate the blocks from the rest of the page.

Is there a better way to segregate the HTML "data"? Maybe something I haven't thought of?

A: 

How about populating a div using javascript? That way the HTML would be processed completely seperately and shouldn't hurt the rest of the page

Kevin Laity
It could still break the <div>.
craigmoliver
+3  A: 

Just let them put anything they want on FCKEditor, and before saving it to the database use http://htmlpurifier.org/ to filter out all the "bad html"

L. Cosio
A: 

I think there are no reasons to use iframes for this. Much better to use a light version of FCK Editior, showing just the buttons for Strong and Italic text, links and the elements that you need (if possible just the essential: h2, h3, h4, p and lists). FCK Editor is highly configurable and I think is never a good idea to give to the users the ability of write too complex html. The typography is almost 90% of web design and people that insert contents shoul just insert content, not style it.

alexmeia
A: 

I ended up using the iframes because I didn't want to load n FCKEditors.

craigmoliver