<![CDATA[ Installer TV .tpl files - My Forums]]> https://forums.modx.com/thread/?thread=32947 <![CDATA[Re: Installer TV .tpl files]]> https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181076 Quote from: Seel-Media at Apr 13, 2010, 02:36 PM

hey. i have some trouble with my tv file during the install...

/**
 * meta-robots
 * 
 * Robots
 *
 * @category        tv
 * @name            meta-robots
 * @internal        @caption Meta Robots
 * @internal        @input_type dropdown
 * @internal        @input_options index,follow||noindex,follow||noindex,nofollow||index,nofollow
 * @internal        @input_default index,follow
 * @internal        @template_assignments standardTpl
 * @internal        @modx_category Meta
 */


Error Msg:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’’index,follow||noindex,follow||noindex,nofollow||index,nofollow’,’’,’’,’index,fo’ at line 1

any hints?


I have a similar error though it’s not as specific, it simply ends on "to use."
Has anyone successfully been able to use TVs on an install?]]>
rx2 May 25, 2010, 10:22 AM https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181076
<![CDATA[Re: Installer TV .tpl files]]> https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181075
/**
 * meta-robots
 * 
 * Robots
 *
 * @category        tv
 * @name            meta-robots
 * @internal        @caption Meta Robots
 * @internal        @input_type dropdown
 * @internal        @input_options index,follow||noindex,follow||noindex,nofollow||index,nofollow
 * @internal        @input_default index,follow
 * @internal        @template_assignments standardTpl
 * @internal        @modx_category Meta
 */


Error Msg:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’’index,follow||noindex,follow||noindex,nofollow||index,nofollow’,’’,’’,’index,fo’ at line 1

any hints?
]]>
Seel-Media Apr 13, 2010, 09:36 AM https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181075
<![CDATA[Re: Installer TV .tpl files]]> https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181074 sottwell Apr 09, 2010, 05:08 AM https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181074 <![CDATA[Re: Installer TV .tpl files]]> https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181073 rx2 Apr 09, 2010, 12:21 AM https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181073 <![CDATA[Re: Installer TV .tpl files]]> https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181072 sottwell Apr 08, 2010, 10:30 AM https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181072 <![CDATA[Re: Installer TV .tpl files]]> https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181071 Input Types

The input types that can be used are:

  • text: Text
  • textarea: Textarea
  • textareamini: Textarea (Mini)
  • richtext: RichText
  • dropdown: DropDown List Menu
  • listbox: Listbox (Single-Select)
  • listbox-multiple: Listbox (Multi-Select)
  • option: Radio Options
  • checkbox: Check Box
  • image: Image
  • file: File
  • url: URL
  • email: Email
  • number: Number
  • date: Date

Output Widgets

The possible output widgets are:

Widgets


  • datagrid: Data Grid
  • floater: Floater
  • marquee: Marquee
  • richtext: RichText
  • ticker: Ticker
  • viewport: View Port

Formats


  • htmlentities: HTML Entities
  • date: Date Formatter
  • unixtime: Unixtime
  • delim: Delimited List
  • htmltag: HTML Generic Tag
  • hyperlink: Hyperlink
  • image: Image
  • string: String Formatter

Description
Also I added this:
* @internal        @description How Many Articles Summaries Per Page?

That is unneeded, as the description is pulled from the top part of the docblock (the line below the title of the TV), so in your example, the description would be set to:
Summary Count for Articles

]]>
garryn Apr 08, 2010, 06:16 AM https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181071
<![CDATA[Re: Installer TV .tpl files]]> https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181070
tmplvars.inc.php handles basic TV stuff, like making the fields. This is the one you are interested in; it has a switch() statement where you can find all of the input types.

tmplvars.commands.inc.php handles @ bindings.

tmplvars.format.inc.php handles the output widgets.

Unfortunately the mutate_content.dynamic.php file is mixed HTML and PHP, with the TV fields for the template being generated on the fly, so you can’t use a plugin with the OnDocFormPrerender event to create custom TVs. While you can use snippets to provide custom output widgets, there is no way to have custom input types without hacking the tmplvars.inc.php file.]]>
sottwell Apr 08, 2010, 01:38 AM https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181070
<![CDATA[Re: Installer TV .tpl files]]> https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181069 Quote from: rthrash at Apr 06, 2010, 10:22 PM

(admin note: split from another thread)

Thanks Ryan. This would be useful information to have to take advantage of this fabulous feature.]]>
rx2 Apr 07, 2010, 10:11 PM https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181069
<![CDATA[Re: Installer TV .tpl files]]> https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181068 rethrash Apr 06, 2010, 05:22 PM https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181068 <![CDATA[Installer TV .tpl files]]> https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181067 Quote from: garryn at Mar 29, 2010, 04:53 PM

Quote from: sottwell at Mar 29, 2010, 12:29 PM
How are you handling the assignment of the TVs to their respective templates? I just added this to SkinGraft, but that’s only with one template being installed ...
Well, you can see how the TVs are handled in the installer by viewing this changeset.

Basically, the TV definition file (placed in the /install/assets/tvs/ folder) would look like this (note, some of my values are sheer gobblydegook) :
/**
 * My Test TV
 * 
 * My Description for my TV
 *
 * @category        tv
 * @name            testTV
 * @internal        @caption My Test TV
 * @internal        @input_type richtext
 * @internal        @input_options x==1||y==2
 * @internal        @input_default x
 * @internal        @output_widget datagrid
 * @internal        @output_widget_params x=1&y=2&z=3
 * @internal        @lock_tv 1
 * @internal        @template_assignments MODxHost
 * @internal        @modx_category Test
 */


A comma-separated list of @template_assignments would assign that TV to each of those templates.

Excellent. How do we find out the name of the input types? For example I want to install a number of TVs we use for blogging. One allows the user to select how many recent articles are shown:

/**
 * Articles Summary
 * 
 * Summary Count for Articles
 *
 * @category        tv
 * @name            articlesummaries
 * @internal        @caption Article Summaries
 * @internal        @description How Many Articles Summaries Per Page?
 * @internal        @input_type drop 
 * @internal        @input_options 1||2||3||4||5||6||7||8||9||10||11||12||13||14||15||16||17||18||19||20
 * @internal        @input_default 3
 * @internal        @output_widget 
 * @internal        @output_widget_params
 * @internal        @lock_tv
 * @internal        @template_assignments blog-index,Blog,Video Blog
 * @internal        @modx_category Ditto
 */


This is a drop down list menu. But what is the name of that input type for this? It’s probably not drop as indicated below. Is there documentation about what each list type is called?

 * @internal        @input_type drop 


Also I added this:

 * @internal        @description How Many Articles Summaries Per Page?


As it was not in your original description. Is that valid as well? We have about 30 TVs to create in this manner so we want to get it right.
]]>
rx2 Apr 06, 2010, 03:39 PM https://forums.modx.com/thread/32947/installer-tv-tpl-files#dis-post-181067