Template data

Hello.
while playing imported template in Caspercg client ,What should Iwill give as Key and value.From where I get these Template data?

The names of the keys used in a template are defined by the person or persons who wrote the template code, so there is not a direct answer to your question.

Many templates use keys named f0, f1, f2 etc because the SVT standard client can auto generate those names by a click on the + in the inspector. Key names can be any string - “author”, “presenter”, “homescore”.

A simple test for your template is to use f0 with value Line 1 text, f1 with value Line 2 text etc and see if anything appears on the CasparCG output when the template is played.

Otherwise you need to open the HTML template code in a text editor and read the code to see if the author has documented the key names. If not, you need to examine the update() function to see how data sent from a client is placed in the final display element, and this will reveal the key names. You my find the key name is used as the id of the HTML <DIV>, for example the first token may be in a div called f0 as illustrated below:

<DIV id="f0" class="main-name-display"></DIV>

There is a description of templates starting at page 9 in my “Introduction to CaspaCG” documentation available here on Github. There is also an example lower third template code in Appendix H on page 135.

The repository that has the PDF document also has two very simple templates, both use key names f0 and f1 and the usage is described in the templates folder README.MD.

1 Like

Thank you very much for your reply.