<![CDATA[ Template Variables (TV's) Explained with Example (For Newbies) - My Forums]]> https://forums.modx.com/thread/?thread=15509 <![CDATA[Re: Template Variables (TV's) Explained with Example (For Newbies)]]> https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=3#dis-post-83470
Many thanks!]]>
worchyld Oct 10, 2007, 10:36 AM https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=3#dis-post-83470
<![CDATA[Re: Template Variables (TV's) Explained with Example (For Newbies)]]> https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=3#dis-post-83469
2. The data goes into a bunch of tables

modx_site_tmplvars : which holds the caracteristics of the TV
modx_site_tmplvar_access : which holds who can access which TV
modx_site_tmplvar_contentvalues : which holds the TVs content
modx_site_tmplvar_templates : which maps TVs to templates

Retrieving, displaying it is fairly simple using Ditto, GetField or a custom snippet (but Ditto should do the trick 95% of the times)

3. Yes, you’re right. Now beware that depending of how many records we’re talking about, there is a limit of documents you can practically handle with MODx (current reasonnable limit is 5000). If you need to handle a very high document count, then you’ll have to create a custom DB and custom snippet to retrieve it...


]]>
davidm Oct 10, 2007, 09:54 AM https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=3#dis-post-83469
<![CDATA[Re: Template Variables (TV's) Explained with Example (For Newbies)]]> https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=3#dis-post-83468
1. Am I right in thinking that you can use TV to store data into a page by adding fields to the end of the page editor. (ie: company address, etc)
2. Where does this data go? How do you retrieve it?
3. Am I right in thinking that you could use TV to store a lot of data (ie: company data, etc)?

Thanks.]]>
worchyld Oct 10, 2007, 09:36 AM https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=3#dis-post-83468
<![CDATA[Re: Template Variables (TV's) Explained with Example (For Newbies)]]> https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=3#dis-post-83467 Daedalus Feb 12, 2007, 09:18 AM https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=3#dis-post-83467 <![CDATA[Re: Template Variables (TV's) Explained with Example (For Newbies)]]> https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=3#dis-post-83466 Quote from: sottwell at Jan 19, 2007, 06:11 AM

Well, at the top of the Document Tree there is a little icon that looks like a folder with a paper and a green plus sign on it, and when you hover your mouse over it it says "New Document"; there is a menu item right there in the first "Site" tab, "New Document".


Ok thank you very much. Im getting there... grin]]>
Wolf Jan 19, 2007, 12:59 AM https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=3#dis-post-83466
<![CDATA[Re: Template Variables (TV's) Explained with Example (For Newbies)]]> https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=3#dis-post-83465 ]]> sottwell Jan 19, 2007, 12:11 AM https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=3#dis-post-83465 <![CDATA[Re: Template Variables (TV's) Explained with Example (For Newbies)]]> https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=3#dis-post-83464 Quote from: sottwell at Jan 19, 2007, 05:44 AM

Everywhere you put the TV tag, it willl be displayed, whether in a template or in document content or chunks. Wherever the MODx parser sees [*MyTVName*] it will replace the tags with the output of the TV.

If you put a default value when you create the TV, every document will have that value unless you edit it for a given document. You can use "@INHERIT" as the default value. When you do that, edit the TV for a "folder/container" document, and all of its children will automatically inherit that value.

Tested and works like a charm. Thank you very much. Just one more question please (im a newbie). How you create pages with modx? For instance, i have a index page and now i wish to have a another page call "news". Help will be much appreciated.

You Rock!


]]>
Wolf Jan 19, 2007, 12:02 AM https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=3#dis-post-83464
<![CDATA[Re: Template Variables (TV's) Explained with Example (For Newbies)]]> https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=2#dis-post-83463
If you put a default value when you create the TV, every document will have that value unless you edit it for a given document. You can use "@INHERIT" as the default value. When you do that, edit the TV for a "folder/container" document, and all of its children will automatically inherit that value.

]]>
sottwell Jan 18, 2007, 11:44 PM https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=2#dis-post-83463
<![CDATA[Re: Template Variables (TV's) Explained with Example (For Newbies)]]> https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=2#dis-post-83462 Wolf Jan 18, 2007, 10:25 PM https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=2#dis-post-83462 <![CDATA[Re: Template Variables (TV's) Explained with Example (For Newbies)]]> https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=2#dis-post-83461 ZAP Jan 12, 2007, 11:49 AM https://forums.modx.com/thread/15509/template-variables-tv-s-explained-with-example-for-newbies?page=2#dis-post-83461