Simpple HTML example for JSON and XML

template

#1

Hi
I want to make template with Google Web Designer but I cant figure out how to send data from Caspar to template.

Lets say I want to make lower third graphics. And for this example the lower third contains only text: Hi! My name is xxxxx

How can I send data to template so that when in Caspar I add Template settings Key: Name Value: BatMan. This value “BatMan” is updated to template and shows text: Hi! My name is BatMan


#2

Hi Tuomas,

We also have a question on this, although we are a bit further:

Here is described, how you generally use HTML-Templates: https://github.com/CasparCG/help/wiki/Media:-HTML-Templates

So whenever you place a command triggering like:

CG 1-1 ADD 0 myhtmlfile 0 [data]

This automatically calls the JavaScript-Function update(templatedata) if that is defined in your html page or in a JS-file that is referenced via the html page.

Our problem is, that we can enter the method, however we do not know how to process “templatedata” or how to manipulate the dom-tree, which was our goal in the first place.

Currently we always get a pipe error.

[2018-10-08 16:48:24.75[1008/164824:ERROR:ipc_channel_win.cc(405)] pipe error: 2322] [12820] [info] Received message from 127.0.0.1: CG 1-1 ADD 0 basis 0 {‘test’}\r\n

So it seems our main problem is, how to escape the parameters to avoid the pipe error.