I'm curious as to whether or not anyone has seen this before -- I'd like to use a dual-templating system. A regular template system like Smarty for most of the page design (i.e. header/footer stuff), and then the database to hold necessary form elements for certain pages.
For the second part (form templating within the database), here's an example: let's say I have a bunch of clients. For some clients, I would like certain form elements in their "edit account" area to appear, and different form elements to appear for other clients. I could (and currently do) write special cases into the code that make it so that if you are Client A, then the form elements appropriate to your account appear, and if you are Client B, then the form elements that are appropriate to you appear only for you. (Don't ask why some are necessary for some people, and others aren't for others -- that's the nature of the beast that I'm working with). We've done some intelligent database design so that certain elements apply to one group of clients and other elements apply to other clients, but ultimately, there's no way to get past putting some sort of spaghetti code to turn on or off certain form elements for certain users, as there are so many special cases for specific users.
What I'd like to do is make it so that all form fields are actually stored in the database -- and that we can then turn on or off each field for each user (or group of users) as needed through some sort of control panel (which is of course storing this turn on/off data in the database as well). Has anyone seen anything like this? Do you foresee any problem in doing this sort of thing? Any tips or suggestions?