I am creating a web-application which lets you select a template from the template list and then user can edit that template on my website by drag and drop and normal wysiwyg editor. Now my question is,
What is the best practise?
- Create base template in php and keep changing the values of component through ajax calls. or…
- Manipulate entire template on client side(only using javascript) and while saving, get current state of template and send it onto the server for persistence.(I am not sure this is a viable idea)
Help will be appreciated. Currently I am building all the editing tools like colour palettes and adding NicEdit lightweight text editor. Mostly everything is using Jquery lib so please do let me know if you know a way to tackle this problem through Jquery.
The solution can vary based on what exact requirements (including traffic on this app) you are trying to achieve.
If i were to create this from scratch, i will probably choose a hybrid solution:
PS: Make sure you add an event on page unload and other related events, so that you make sure you have synced your client side template state with backend, before user leaves the page.