I have a few questions about creating custom content types. I am coming from a background of using both custom fields in Wordpress and Pods CMS in Wordpress.
Pods creates a new table for each new "pods" type. So for example you created a pods type called NEWS (that contains: Headline, Sub-title, Main Photo, Main Content) pods will go and create a new table in the database with a name of "News". The image information is stored in a separate table but that’s another thing...
Custom fields, on the other hand, is more like "meta-data" that is added to an existing Wordpress table in terms on key-value pairs.
For me the advantage of using something like Pods is that is it very easy to relate multiple pods (since they are tables), for example "News" and "Journalist" or say, "Employee" and "Payroll".
I was just wondering if Template Variables work more like the way pods do (as tables that can relate to each other) or as custom fields do in Wordpress (as meta information attached to a table column...)
The template variables themselves are in their own table, but all that’s stored there is the stuff you enter when creating the TV (default value, input options, type, etc.).
The actual values of the TV for each resource are in a separate table with (in addition to the index) just the TV’s ID (tmplvarid), Resource ID (contentid), and Value (value) in each row.
There’s also another table that relates TVs to templates with just the TV ID (tmplvarid) and Template ID (templateid) in each row.
When you execute $resource->getTVValue($resourceId), the template variable table still has to be queried, however, to find out what kind of TV it is in order to render it properly.