Forms are content patterns. Every day we encounter lots of formatted information: weather forecasts, sports cards, restaurant menus, user profile pages, tax documents and nutrition labels each have their own pattern of what information is included, and how it is laid out. These patterns help you compare and contrast information visually, and to notice missing information.


Wagn lets you create forms and apply them to Set of cards, so they contain the same kinds of information with the same structure.  It does so using two Setting: *structure and *default



Open these two Recipe cards, and you'll see they have the same structure:

You'll also see the same pattern when you create a new Recipe card.


Here's the structure rule that is used to template Recipes:

You'll notice the form includes cards for recipe information like preparation and cook time, number served, ingredients, etc.  When a user edits a recipe, Wagn offers to add or edit those cards.




Wagn supports formatting with rules  (configurations that can apply to any Set of cards).


*structure and *default rules

  • *default rules control cards' initial type and content.  Changing a *default rule won't impact existing cards.
  • *structure rules control cards' current type and content.   Changing a *structure rule will impact every card in the rule's Set.


Special navigation to and from *structure rules


In addition to the common rule navigation described in rules+howto, there are two special menus items for navigating to *structure rules:

  1. edit > structure.  Any structured card (like a  Recipe) will present this menu option to anyone with permission to edit the rule.  It opens directly to an edit view.
  2. view > structure.  Similarly, anyone with that permission can view the rule directly with this menu item.

The latter is especially useful, because it offers quick links to each of the nesting on the rule, which makes it simple to alter those rules.



Naming patterns via inclusions


Consider again our example of the recipe form card:

Looking at that card, you'll notice lots of nesting, like {{+ingredients|open}}.  Here's a brief overview of how this works:

  • The double curly brackets (\{{) represent an nesting, meaning that one card is inside another.  In this case, the ingredients card is inside the recipe card.
  • The "+" before "ingredients" indicates that this is a contextual names, meaning that the included card receives a name relative to the including card.  For example, if I make a recipe called "Lobster Bisque", then its ingredient list will be named "Lobster Bisque+ingredients".
  • The "open" refers to the views of the included card.  When you see the ingredients card inside the recipe, it will be open.

The important pattern to understand is that these structured inclusions establish naming patterns. All the cards that contain information about ingredients will have names that begin with the recipe name and end with "+ingredients".  These naming patterns are key to Wagn's organizational capabilities.



Fields on structured cards


Typically when we create structured cards, we treat the included cards as "fields".  And we often want to set the default type and/or content for those fields.  Setting up field types can be done by using the capabilities outlined above in combination.


For example, when viewing the Recipe structure rule included above, you can click on any inclusion to open up its rules.  If you click on +diet, you will see that its *default rule determines that any +diet card will, by default, have the type Pointer and the content "conventional". 



See also



  • Checkboxes, radio buttons, and other form elements can be added using Pointer.
  • You can add help text that shows up when inclusions are being created or edited.