[CS1] Design Templates

Templates in Component Studio are anything inside of braces. 

{ }

You can use templates anywhere you can type in text within a design. So you can use them on the Text field of the Add Text step, or the color field of an Add Box step.

Template Language Features

Inside of a template, you can perform basic math functions like so:

{ 2 + 2 }

And the output in the rendered image will of course be 4.

You could also insert a string of text

Hello { 'Jim' }

Which would output Hello Jim. Note that when you have a string of text it must apear inside a pair of half quotes ('text') or quotes ("text").

You can also use  component variables like this:

{ $name }

And  system variables like this:

{ $_.width }

You might even use two or more templates and variables within the same text box to create madlibs like this:

The { $adjective } { $animal } took a bite out of {$person}'s apple.

And even  functions like this:

{ ucfirst('jim') }

And you can combine variables and functions like this:

{ ucfirst($name) }

Or even get into fancy programmer stuff like ternary conditions like this:

{ $alert == 'red' ? 'white' : 'black' }

There are many operators that allow you to do fancy things. For example, if you need to concatenate 2 strings together, do this:

{ 'Armor ' ~ $armor }
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us