I wouldn’t touch the existing tables. It’s just that I have noticed that it would be neat, if the output of the core variables could be handled like the one for the template variables.
Example:
The "tmplvars" table contains a bunch of useful values e.g.
id (unique id)
type (date, rich text, image...)
name (variable name)
caption (name in forms)
description (a description or helptext)
editor_type (0-plain text,1-rich text,2-code editor. I suppose this should be a trigger if tinymce kicks in, but I don't think it work that way)
category (category id)
locked (or not)
elements (needed for checkboxes, select fields and radio buttons)
rank (order of appearance within the template variables form. I also think that this always works as expected)
display (used to transfor input to a different format. For example transform date input into unixtime)
display_params (a list of tag attributes as for example height, width oder edt=TinyMCE)
default_text (Could be useful to insert "Input required" into a form field)
Handy. Why don’t we have a "corvars" table?
Right now most of those parameters are hardcoded into mutate_content.dynamic.php. For each and every variable included into the output there is a complete html tag spiced up with some php to fill in the values. There is no way to change the order of appearance, to move a variable from one tab to another or to prevent it from appearing.
tmplvars.inc.php however is more versatile and can be customized more easily. Whats wrong with changing part of the code so it can look upwhether longtitle is a textfield or just text? tmplvars has to do it all the time.
I think it would be much more convinient to go to ressources -> manage ressources -> "core variables". We would have a list there with some (not all) of the document specific "core variables". Hit "introtext" and change its name in the form from "Summary(Introtext)" to "synopsis". Add a descriptive text and set default text like for example "required". Note, though you can change the variables caption, you are not alowed to change the internaly used variable name.
Now go back to "templates" choose a template and hit the "assign variables tab". Here you will find two scrollable textfields the one on the left containing all variables (core and template). The left one empty apart from some default values, that cannot be changed but set to "readonly". Drag and drop the necessary variables to the right. Move them up or down. Insert spacers (representing a tab) and give those tabs a name. The Default behavious could be the one we already have, so you wouldn’t have to do anything if you are find with the situation. If not. Go ahead.
The advantage would be that you can create "unique" document items like for examples "Quote of the day" or "image with caption and title".
Of course it might be necessary to remove some variables from the selection. For example: A documents unique ID should be a system decision.
A problem I see, is that we would have to think about the difference of template and layout. As I understand it right now, they mean about the same (something I still have a problem to understand. Though it has it’s advantages, it feels queer).
I have to admit, that most of the functionality could be accomplished by a a couple of two-dimensional arrays. But using a database would make it easier for plugin developers to add additional funtionalities.
Regards,
pepebe