I need to provide a simple HTML editor, so the end-user may edit a page content easily.
But the trick is:
The page code is prepared by a professional designer who should be able to compose it in such a way, that only certain areas are editable while the rest of page code remains locked aginst the end-user.
So, you may think about it as in case of Dreamweaver template - only code between
tags should be accessible for the end-user.
Any idea how to attack this problem in a clever way?
Trace editable and non-editable regions regions with appropriate algorithm
Render them part by part in a view form using:
<input type="textarea">echo $this->editableData</textarea> for editable regions and
<div>echo $this->nonEditableData</div> in case of non editable regions
Apply WYSWIG editor instances to all ‘textareas’ with javascript.
While saving data with WYSWIG editor - pass them through controller, substitute appropriate regions in model data with submitted ones and save the updated model.
Does it sound reasonable or you have some objections? Please share your opinion!