Conditional List of Colors

This page uses an HTML Form and a Conditional Hashtag List to show matching Color Names, but only when a color name is provided.  



Processed this Hashtag Markup:
<# if("<#[url.color]#>"!="") {
	<# start list for colors;
		include when name ~ "<#[url.color]#>";
		show 5 rows per page;
	#>

	<# start header #>
	<table class="table table-striped table-hover">
		<thead>
		<tr>
			<th>Color</th>
			<th>Name</th>
			<th>Hex</th>
			<th class="text-right">Red</th>
			<th class="text-right">Green</th>
			<th class="text-right">Blue</th>
		</tr>
		</thead>
	<# end header #>

	<# start row #>
		<tr>
			<td style="background-color:<# hex #>">&nbsp;</td>
			<td><# name #></td>
			<td class="monospace"><# hex #></td>
			<td class="text-right"><# r #></td>
			<td class="text-right"><# g #></td>
			<td class="text-right"><# b #></td>
		</tr>
	<# end row #>

	<# start footer #>
	</table>
	<# end footer #>

	<# no results #>
	<# redirect to "/lists/purge?land=pager"; #>
	<# end no results #>

	<# end list #>	
} #>


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

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