Quote from: blitz at Aug 02, 2006, 12:16 PM
What I DO understand is that TVs can somehow control what content (documents, chunks, snippets) appear depending on what page you’re on. (The Joomla analogy would be assigning specific modules to positions on your template depending on what which link you’re on). But beyond that, I still don’t have a basic understanding of how TV’s work and can’t find practical examples of how I, as a designer (with no coding knowledge) can use TV’s on a template that I design.
A TV *is* a document content field. It is a specific element of content. In addition to built-in fields like content and title, you can add your own fields. It is feasible to have a document that does not use the main content area - instead you might have TV fields for "Film Name", "Film Poster", "Film Review", "Film Rating" and your template would just reference the TVs in the right places. However, most often they are in addition to the content area.
A Template Variable is defined in your MODx manager - it may be plain text, a picture, a link. You can have a default value. You can make it available to templates. When editing a document, you can set the value of the TV.
Because of the way the TV is saved with the document, you can use it in the template - and also it in other ways. You could reference it within content. You could have a snippet that referenced it. You can also have snippets on other pages that reference it - for example a list of film names with ratings can be generated from a set of documents with TVs.
By separating out the content into definable elements like this, design can be fully separated from content.
MODx will let you create a document with a content field where you’ve made the film name bigger, included a picture and the review and had the rating at the end. But that’s not really a good idea - someone’s bound to use the wrong font setting on one film and your reviews section will look messy.
A widget basically formats your TV for display - your content may be saved as "mypicture.gif", but the widget will turn this into an image link.
A data binding lets you select the choice of field content from a list or database. This is more advanced stuff, but it’s actually pretty easy once you get the hang of it.
Plugins generally change the way MODx handles document processing. Modules are again generally add-ins that don’t affect the basic "design sites" stuff, other than giving you new ways to edit things. Don’t worry about them.