Quote from: CMCDragonkai at Dec 12, 2008, 06:01 PM
Ah thought so, but this part of the documentation is very confusing. http://www.modxcms.com/creating-a-template-variable.html
Are you saying, a TV could be a dynamically changed chunk? Such as maybe a form text field. But then, what is the point of having a TV, where a simple snippet could do the same?
One way to think of it is that the existing fields on the create/edit document screen (content, pagetitle, longtitle, etc.) are TVs. But if that form doesn’t meet your needs (say you’d like two content areas that will be shown in different places on the screen), you can add other fields, by creating custom TVs (e.g. an extra_content TV). They’ll then show up on the create/edit document screen in the Manager for every doc that uses a template that the particular TV is assigned to. As you can see on the page you mention in your post, there are a number of types of TVs that you can use, which is much easier, once you get used to it, than creating a custom snippet to do what you want. Of course, creating a snippet is always an option if you prefer to do it that way.
The biggest advantage over doing it in a snippet, IMO, is that you can easily edit the content of the TV in the Manager. You can also write snippets and plugins that will respond to the particular value of the TV on the current page so, again, you can make major changes to what’s on the screen by making simple changes to the TV in the Manager.
I have sites that don’t have any TVs so they’re by no means necessary. The site in my sig, for example, doesn’t have a single custom TV.
Hope this makes sense.