I’m coding a templating system that is supposed to support easily converting any old html/xhtml form into a format that can be used with my system (it’s a template system for my cms).
Here’s what I’m aiming for:
- The user clicks a “Zone Define” button for example: “Content”, “Sidebar”, etc
- When the user hovers any elements they become get a border or are highlighted somehow
- If the user clicks that element it is modified to have a class like ‘zone-content’
- The page sends the new html to the script via ajax
Is there any already existing libraries that would facilitate something like this?
UPDATE:
I ended up using the answers below and hacking together a jquery solution (we’re going to use jquery in the rest of the project). It’s a bit ugly and hacky but it works
http://ilsken.com/labs/template/
I personally am a fan of ExtJS (now Sencha), and this is fairly simple and straightforward to do using that framework. This is how I’d do it:
I would also add the following CSS rules for hovering effects, etc.
I would call this pseduo-code, but the idea should be enough to get you started. Since you are dealing with user input, you will have a lot of corner cases to check for before you can call this production-ready. It sounds like a cool way to define the template, good luck!