Template Commands
Template commands are similar to "shortcodes" in WordPress - they are small pieces of code that let you do nifty things with very little effort. They are specific codes that help you embed files or create objects that would require a lot of complicated, ugly code in just one line.
Shortcodes can take parameters and can be single or enclosed. For example, a shortcode to embed a YouTube video might look like this:
{wrt youtube id=1234}
Creating Template Commands
Template commands are added to the Wrangler/TemplateCommands
directory. you cna use the following artisan command to create a new command:
php artisan textstem:make:templatecommand MyCommand
They will create a new skeleton class for you.
Template commands have a constructor which will receive the an array of parameters, and a render function. For example, a Youtube template command to render a youtube embed from an idea might look like this:
The static $signature property is optional. It is used by the HTML Editor to prompt for parameters.