An Introduction To Checkboxes - June 17, 2009
Vae's Checkbox Structure is a great way to store boolean values. Checkboxes hold a yes-or-no value which you can use with the
<v:if> tag to perform conditional statements in your code. As an example, we'll add one to our Action Verb Record store, and perform a basic if-statement with it.
Here we are adding a new Checkbox Structure to our Artists Collection in the Backstage:
Once you've added your Checkbox, you can set it's value under the Content tab. For our example, we'll check the Checkbox under the Collection for 'The Sheets':
Great, now for each Artist we can perform an if statement to see if this Checkbox is checked, and it will only be true for 'The Sheets'. We'll do this on the page where we list our Artists, and we'll modify the Artists listing if they have the 'Has albums on sale' Checkbox checked.
<h3><v:a><v:text path="artist_name"/><v:if path="has_albums_on_sale"> -- Album Sale Going On Now!</v:if></v:a></h3>
Great, now 'The Sheets' appear with the modified title:
...and today's mini-tutorial is complete! Please contact your account manager, or email us, if you'd like to see more examples on how to use the Checkbox Structure.