Switch Templates

This page demonstrates a Hashtag Markup Switch Templates.   Switch Templates can be used when a specific variable value determines which process should run.   In this example, the Default Case template uses a self-posting HTML form to set the Switch Variable.  

Processed this Hashtag Markup:
<# start switch for post.sku as bucket; #>

	<# start case "cat" #>
	Meow! Cat #<#[post.sku as key as html]#>
	<# end case #>

	<# start case "dog" #>
	Woof! Dog #<#[post.sku as key as html]#>
	<# end case #>

	<# start default case #>
	<form method="post" action="switch">
		<select name="sku">
			<option value="cat.1">Cat #1</option>
			<option value="cat.2">Cat #2</option>
			<option value="dog.1">Dog #1</option>
			<option value="dog.2">Dog #2</option>
		</select>
		<input type="submit">
	</form>
	<# end case #>

<# end switch #>



The Hashtag Markup Language provides multiple ways to conditionally display content or execute commands.

Conditional Templates and { Blocks } are demonstrated to compare and contrast.