We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    Template Variables were intended to provide resource-specific values for a template. They have proven to be useful for a great deal more, but they are still tied to a Template, and only resources using that Template will have the TV fields. So you can consider them as extra resource fields.

    TVs come with a variety of Input Options, which control what type of input fields the TV will present when editing a resource. The default is a simple text field. Image type TVs automatically provide a button to open the Media Browser, where you can select or upload images. The value of the TV will be the path to the image file.

    TV tags use the same tag as resource fields, [[*tvname]].

    A TVs value is stored in the site_tmplvar_contentvalues table. This table has the TV ID, the resource ID, and the value of that TV for that resource. There are a number of API functions for getting the value of a given TV.
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org