We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5518
    • 28 Posts
    After reading the documentation on TVs, I still don’t understand what it is. Is it equivalent to some kind of variable? What can you do with it anyway? A visual example would help.

    Thanks.
      • 12556
      • 103 Posts
      In some of the examples you’ll see inside the <title> tag [*pagetitle*] and [(site_name)].  I believe these are TVs because they are variable, i.e. the content displayed there changes if you change the name of the site or as you switch from page to page.  Why one is enclosed in [* *] and the other [( )] I have no idea.
      Dave

      Edit: Also, you can create your own TVs called [*whateverYouWantToNameIt*] and have that be replaced in your templates with various things that you configure on the Template Variables tab of the manager.
        • 5518
        • 28 Posts
        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?
          • 3749
          • 24,544 Posts
          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.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 5518
            • 28 Posts
            Ah that solves it. BTW this page of the documentation http://modxcms.com/view-port-widget.html is missing the link to the next page or previous page, which the richtext page http://modxcms.com/richtext-box-widget.html
              • 34017
              • 898 Posts
              TVs are extra content fields. My signature has some examples.
                Chuck the Trukk
                ProWebscape.com :: Nashville-WebDesign.com
                - - - - - - - -
                What are TV's? Here's some info below.
                http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
                http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008